mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
lib/flake-utils: update mkUser
This commit is contained in:
parent
f21c92a5b7
commit
18418df527
@ -68,18 +68,12 @@ in rec {
|
|||||||
=> { ... } # A home-manager configuration set.
|
=> { ... } # A home-manager configuration set.
|
||||||
*/
|
*/
|
||||||
mkUser = file:
|
mkUser = file:
|
||||||
attrs@{ username ? (builtins.baseNameOf file), system ? sys
|
{ username ? (builtins.baseNameOf file), system ? sys
|
||||||
, extraModules ? [ ], extraSpecialArgs ? { inherit lib system; }, ... }:
|
, extraModules ? [ ], extraSpecialArgs ? { inherit lib system; } }:
|
||||||
let
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
hmConfigFunctionArgs = builtins.attrNames (builtins.functionArgs
|
|
||||||
inputs.home-manager.lib.homeManagerConfiguration);
|
|
||||||
hmModules = lib.map (path: import path)
|
|
||||||
(lib.modulesToList (lib.filesToAttrRec ../modules/home-manager));
|
|
||||||
in inputs.home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit system username extraSpecialArgs;
|
inherit system username extraSpecialArgs;
|
||||||
configuration = import file;
|
configuration = import file;
|
||||||
homeDirectory = "/home/${username}";
|
homeDirectory = "/home/${username}";
|
||||||
extraModules = hmModules ++ extraModules
|
extraModules = (lib.modulesToList (lib.filesToAttr ../modules/home-manager)) ++ extraModules;
|
||||||
++ [ (lib.filterAttrs (n: _: !lib.elem n hmConfigFunctionArgs) attrs) ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user