1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-05-11 22:49:04 +02:00
parent be9fb9278e
commit b8af0e9761
No known key found for this signature in database
165 changed files with 1815 additions and 1431 deletions

View file

@ -2,15 +2,24 @@
config,
lib,
...
}: {
options.users = let
inherit (lib) types;
in {
}:
let
inherit (lib) types;
filterUsers =
predicate:
(lib.pipe config.users.users [
(lib.filterAttrs (_: predicate))
builtins.attrNames
]);
in
{
options.users = {
normalUsers = lib.mkOption {
type = types.listOf (types.passwdEntry types.str);
description = ''
List of normal users.
'';
readOnly = true;
};
systemUsers = lib.mkOption {
@ -18,15 +27,11 @@
description = ''
List of system users.
'';
readOnly = true;
};
};
config.users = let
filterUsers = pred: (lib.pipe config.users.users [
(lib.filterAttrs (_: pred))
builtins.attrNames
]);
in {
config.users = {
normalUsers = filterUsers (user: user.isNormalUser);
systemUsers = filterUsers (user: user.isSystemUser);
};