split home-manager into their own submodules
This commit is contained in:
40
modules/dev/nix/home.nix
Normal file
40
modules/dev/nix/home.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig ? null,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
shellType = inputs.self.lib.hmShellType config osConfig;
|
||||
hm = inputs.self.lib.hmModule {
|
||||
inherit
|
||||
config
|
||||
inputs
|
||||
osConfig
|
||||
;
|
||||
optionPath = [
|
||||
"dev"
|
||||
"nix"
|
||||
];
|
||||
};
|
||||
cfg = config.my.dev.nix;
|
||||
nix = import ./common.nix {
|
||||
inherit pkgs;
|
||||
hostName = if osConfig == null then null else osConfig.networking.hostName;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.my.dev.nix.enable = lib.mkEnableOption "Install Nix tooling globally";
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
my.dev.nix.enable = lib.mkDefault hm.enabledByDefault;
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = nix.packages;
|
||||
programs.${shellType}.shellAliases =
|
||||
inputs.self.lib.mergeAliases inputs.self.lib.commonAliases nix.shellAliases;
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user