Skip to content

Commit a03adca

Browse files
committed
Add nixos.users.users.<name>.name
Signed-off-by: magic_rb <magic_rb@redalder.org>
1 parent 9b34078 commit a03adca

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/nixos/users.nix

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
options = {
44
nixos.users.users = lib.mkOption {
55
type = lib.types.attrsOf (
6-
lib.types.submodule {
6+
lib.types.submodule ({name, ...}: {
77
options = {
88
description = lib.mkOption { type = lib.types.str; };
99
createHome = lib.mkOption { type = lib.types.bool; };
@@ -22,8 +22,13 @@
2222
type = lib.types.bool;
2323
default = false;
2424
};
25+
name = lib.mkOption {
26+
type = lib.types.str;
27+
default = name;
28+
readOnly = true;
29+
};
2530
};
26-
}
31+
})
2732
);
2833
default = { };
2934
};
@@ -38,7 +43,7 @@
3843
config = {
3944
users.users =
4045
(lib.mapAttrs (
41-
_: v: lib.filterAttrs (n: _: !lib.elem n [ "isSystemUser" ]) v
46+
_: v: lib.filterAttrs (n: _: !lib.elem n [ "name" "isSystemUser" ]) v
4247
) config.nixos.users.users);
4348
users.groups = config.nixos.users.groups;
4449
};

0 commit comments

Comments
 (0)