lib/private: update getUsers implementation

This commit is contained in:
Gabriel Arazas 2023-10-08 03:29:38 +08:00
parent a6fcc6eec6
commit 8fbbc0ca6d
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -34,7 +34,7 @@ rec {
userModules = lib.filesToAttr ../users/${type}; userModules = lib.filesToAttr ../users/${type};
invalidUsernames = [ "config" "modules" ]; invalidUsernames = [ "config" "modules" ];
users' = lib.filterAttrs (n: _: !lib.elem n invalidUsernames && lib.elem n users) userModules; users' = lib.removeAttrs userModules invalidUsernames;
userList = lib.attrNames users'; userList = lib.attrNames users';
nonExistentUsers = lib.filter (name: !lib.elem name userList) users; nonExistentUsers = lib.filter (name: !lib.elem name userList) users;