mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
31 lines
681 B
Nix
31 lines
681 B
Nix
{ 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)
|
|
];
|
|
};
|
|
}
|