diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 4a24fdc4..0caffb53 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -4,6 +4,7 @@ ./programs/pipewire.nix ./programs/pop-launcher.nix ./programs/borgmatic.nix + ./programs/python.nix ./services/archivebox.nix ./services/borgbackup.nix ./services/borgmatic.nix diff --git a/modules/home-manager/programs/python.nix b/modules/home-manager/programs/python.nix new file mode 100644 index 00000000..80e7c2e9 --- /dev/null +++ b/modules/home-manager/programs/python.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.python; +in +{ + options.programs.python = { + enable = lib.mkEnableOption "user-wide Python installation"; + package = lib.mkPackageOption pkgs "python3" { }; + modules = lib.mkOption { + type = with lib.types; functionTo (listOf package); + default = [ ]; + description = '' + A list of Python modules to be included alongside the Python + installation. + ''; + example = lib.literalExpression '' + ps: with ps; [ + jupyter + ]; + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ + (cfg.package.withPackages cfg.modules) + ]; + }; +}