refactor: clean up a bit
This commit is contained in:
parent
bee307ae9c
commit
a5a784b2d5
4 changed files with 69 additions and 51 deletions
|
|
@ -4,8 +4,10 @@
|
|||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
inherit (lib) range filterAttrs attrNames foldl' head tail mkOption mkEnableOption intersectLists genAttrs flip getAttr;
|
||||
inherit (lib.types) listOf enum package;
|
||||
|
||||
cfg = config.my.programs.python;
|
||||
|
||||
pythonVersions = map (version: "3${toString version}") (range 8 11);
|
||||
|
|
@ -23,7 +25,7 @@ let
|
|||
enable = mkEnableOption (toString version);
|
||||
pythonPackages = mkOption {
|
||||
default = [ ];
|
||||
type = with types; listOf (enum (pythonPackages version));
|
||||
type = listOf (enum (pythonPackages version));
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
@ -32,11 +34,11 @@ in
|
|||
versions = genAttrs pythonVersions versionOpts;
|
||||
defaultPackages = mkOption {
|
||||
default = [ ];
|
||||
type = with types; listOf (enum commonPackages);
|
||||
type = listOf (enum commonPackages);
|
||||
};
|
||||
extraPackages = mkOption {
|
||||
default = [ ];
|
||||
type = with types; listOf package;
|
||||
type = listOf package;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue