37 lines
732 B
Nix
37 lines
732 B
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
osConfig ? null,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
python = import ./common.nix { inherit pkgs; };
|
|
hm = inputs.self.lib.hmModule {
|
|
inherit
|
|
config
|
|
inputs
|
|
osConfig
|
|
;
|
|
optionPath = [
|
|
"dev"
|
|
"python"
|
|
];
|
|
};
|
|
cfg = config.my.dev.python;
|
|
in
|
|
{
|
|
options.my.dev.python.enable = lib.mkEnableOption "Install Python tools globally";
|
|
config = lib.mkMerge [
|
|
{
|
|
my.dev.python.enable = lib.mkDefault hm.enabledByDefault;
|
|
}
|
|
(lib.mkIf cfg.enable {
|
|
home.packages = python.packages;
|
|
xdg.configFile."python/pythonrc".source = ../../../dotfiles/pythonrc;
|
|
home.sessionVariables.PYTHONSTARTUP = "\${XDG_CONFIG_HOME}/python/pythonrc";
|
|
})
|
|
];
|
|
}
|