flake: home-manager: refactor 'mkHome'

This will allow making a similar function for NixOS homes.
This commit is contained in:
Bruno BELANYI 2023-12-07 21:44:01 +00:00
parent d94c9da1c1
commit c593180cf2

View file

@ -20,7 +20,7 @@ let
"${self}/modules/common" "${self}/modules/common"
]; ];
mkHome = name: system: inputs.home-manager.lib.homeManagerConfiguration { mkHomeCommon = mainModules: system: inputs.home-manager.lib.homeManagerConfiguration {
# Work-around for home-manager # Work-around for home-manager
# * not letting me set `lib` as an extraSpecialArgs # * not letting me set `lib` as an extraSpecialArgs
# * not respecting `nixpkgs.overlays` [1] # * not respecting `nixpkgs.overlays` [1]
@ -33,9 +33,7 @@ let
]; ];
}; };
modules = defaultModules ++ [ modules = defaultModules ++ mainModules;
"${self}/hosts/homes/${name}"
];
extraSpecialArgs = { extraSpecialArgs = {
# Inject inputs to use them in global registry # Inject inputs to use them in global registry
@ -45,6 +43,7 @@ let
}; };
}; };
mkHome = name: mkHomeCommon [ "${self}/hosts/homes/${name}" ];
in in
{ {
hosts.homes = { hosts.homes = {