split home-manager into their own submodules
This commit is contained in:
36
modules/dev/python/home.nix
Normal file
36
modules/dev/python/home.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
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";
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user