refactor: clean up a bit

This commit is contained in:
Moritz Böhme 2024-06-17 09:59:39 +02:00
parent bee307ae9c
commit a5a784b2d5
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
4 changed files with 69 additions and 51 deletions

View file

@ -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;
};
};