home-manager/programs/python: init

This commit is contained in:
Gabriel Arazas 2024-11-14 16:17:29 +08:00
parent a5d8ae3e39
commit 8fa4d576f8
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 31 additions and 0 deletions

View File

@ -4,6 +4,7 @@
./programs/pipewire.nix ./programs/pipewire.nix
./programs/pop-launcher.nix ./programs/pop-launcher.nix
./programs/borgmatic.nix ./programs/borgmatic.nix
./programs/python.nix
./services/archivebox.nix ./services/archivebox.nix
./services/borgbackup.nix ./services/borgbackup.nix
./services/borgmatic.nix ./services/borgmatic.nix

View File

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