2021-06-25 20:43:19 +02:00
|
|
|
{ config, inputs, lib, ... }:
|
2021-04-26 19:22:20 +02:00
|
|
|
let
|
2021-06-25 20:40:34 +02:00
|
|
|
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
|
2021-04-26 19:22:20 +02:00
|
|
|
aliasPath = [ "my" "home" ];
|
2021-06-25 20:43:19 +02:00
|
|
|
|
|
|
|
cfg = config.my.user.home;
|
2021-04-26 19:22:20 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
2023-03-11 21:43:39 +01:00
|
|
|
inputs.home-manager.nixosModules.home-manager # enable home-manager options
|
2021-06-25 20:43:19 +02:00
|
|
|
(lib.mkAliasOptionModule aliasPath actualPath) # simplify setting home options
|
2021-04-26 19:22:20 +02:00
|
|
|
];
|
2021-06-25 20:43:19 +02:00
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
home-manager = {
|
2024-01-03 17:50:05 +01:00
|
|
|
users.${config.my.user.name} = {
|
|
|
|
# Not a fan of out-of-directory imports, but this is a good exception
|
|
|
|
imports = [
|
|
|
|
"${inputs.self}/modules/common"
|
|
|
|
"${inputs.self}/modules/home"
|
|
|
|
];
|
|
|
|
};
|
2021-06-25 20:43:19 +02:00
|
|
|
|
|
|
|
# Nix Flakes compatibility
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
2021-10-22 13:06:50 +02:00
|
|
|
|
|
|
|
extraSpecialArgs = {
|
2024-01-03 17:50:05 +01:00
|
|
|
# Forward inputs to home-manager configuration
|
2021-10-22 13:06:50 +02:00
|
|
|
inherit inputs;
|
2024-01-03 17:50:05 +01:00
|
|
|
# For consumption by common modules
|
|
|
|
type = "home";
|
2021-10-22 13:06:50 +02:00
|
|
|
};
|
2021-06-25 20:43:19 +02:00
|
|
|
};
|
|
|
|
};
|
2021-04-26 19:22:20 +02:00
|
|
|
}
|