lib/private: refactor mapHomeManagerUser

This commit is contained in:
Gabriel Arazas 2023-10-03 21:33:16 +08:00
parent 9be7f20438
commit 516b6e84d2
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -14,16 +14,16 @@ rec {
isNormalUser = lib.mkForce true; isNormalUser = lib.mkForce true;
}; };
in in
{ ({ lib, ... }: {
imports = [
{ users.users."${user}" = defaultUserConfig; }
];
home-manager.users."${user}" = { ... }: { home-manager.users."${user}" = { ... }: {
imports = [ (getUser "home-manager" user) ]; imports = [ (getUser "home-manager" user) ];
}; };
users.users."${user}" = settings;
}; users.users."${user}" = lib.mkMerge [
defaultUserConfig
settings
];
});
getSecret = path: ../secrets/${path}; getSecret = path: ../secrets/${path};
@ -44,8 +44,7 @@ rec {
(r: r) (r: r)
users'; users';
getUser = type: user: getUser = type: user: ../users/${type}/${user};
lib.getAttr user (getUsers type [ user ]);
# Import modules with a set blocklist. # Import modules with a set blocklist.
importModules = attrs: importModules = attrs: