2022-08-31 12:01:07 +02:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.my.programs.python;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.programs.python = {
|
|
|
|
enable = mkEnableOption "python";
|
|
|
|
versions = mkOption {
|
|
|
|
default = [ "python310" ];
|
|
|
|
type = with types; listOf str;
|
|
|
|
example = [ "python39" ];
|
|
|
|
apply = versions: builtins.map (version: prev.${version}.withPackages (packages: with packages; [ black pyflakes isort nose pytest python-lsp-server ]));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-08-31 12:33:15 +02:00
|
|
|
home-manager.users.moritz.home.packages = cfg.versions;
|
2022-08-31 12:01:07 +02:00
|
|
|
};
|
|
|
|
}
|