modules: move home configuration from flake
This commit is contained in:
parent
76cac9af51
commit
85ff634331
|
@ -70,13 +70,6 @@
|
||||||
nur.overlay
|
nur.overlay
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
({ config, ... }: {
|
|
||||||
home-manager.users.${config.my.user.name} = import ./home;
|
|
||||||
# Nix Flakes compatibility
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
})
|
|
||||||
# Include generic settings
|
# Include generic settings
|
||||||
./modules
|
./modules
|
||||||
# Include bundles of settings
|
# Include bundles of settings
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
example = "alice";
|
example = "alice";
|
||||||
description = "my username";
|
description = "my username";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
enable = my.mkDisableOption "home-manager configuration";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,24 @@
|
||||||
# Simplify setting home options
|
{ config, inputs, lib, ... }:
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
let
|
||||||
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
|
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
|
||||||
aliasPath = [ "my" "home" ];
|
aliasPath = [ "my" "home" ];
|
||||||
|
|
||||||
|
cfg = config.my.user.home;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(lib.mkAliasOptionModule aliasPath actualPath)
|
inputs.home-manager.nixosModule # enable home-manager options
|
||||||
|
(lib.mkAliasOptionModule aliasPath actualPath) # simplify setting home options
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home-manager = {
|
||||||
|
# Not a fan of out-of-directory imports, but this is a good exception
|
||||||
|
users.${config.my.user.name} = import ../home;
|
||||||
|
|
||||||
|
# Nix Flakes compatibility
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue