whatever
This commit is contained in:
parent
be9fb9278e
commit
b8af0e9761
165 changed files with 1815 additions and 1431 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue