This commit is contained in:
Jan-Bulthuis committed 2025-02-09 01:11:07 +01:00
1 parent f1f4255d7d
commit e2abde8b28
8 files changed
+129 -26

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
{
pkgs,
lib,
config,
...
}:
with lib;
{
options.python = {
enable = mkEnableOption "Python";
packages = mkOption {
type = types.functionTo (types.listOf types.package) // {
merge =
loc: defs: p:
lib.concatMap (def: (def.value p)) defs;
};
default = p: [ ];
description = "Python packages to install";
};
# TODO: Add option to directly read from requirements.txt, maybe with mach-nix
};
config = mkIf config.python.enable {
packages =
with pkgs;
let
packages = config.python.packages;
pythonPackage = python3.withPackages packages;
in
[
pythonPackage
];
};
}