Skip to content

Commit

Permalink
Add nixos.users.users.<name>.name
Browse files Browse the repository at this point in the history
Signed-off-by: magic_rb <[email protected]>
  • Loading branch information
MagicRB committed Jan 1, 2025
1 parent 9b34078 commit a03adca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/nixos/users.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
options = {
nixos.users.users = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule {
lib.types.submodule ({name, ...}: {
options = {
description = lib.mkOption { type = lib.types.str; };
createHome = lib.mkOption { type = lib.types.bool; };
Expand All @@ -22,8 +22,13 @@
type = lib.types.bool;
default = false;
};
name = lib.mkOption {
type = lib.types.str;
default = name;
readOnly = true;
};
};
}
})
);
default = { };
};
Expand All @@ -38,7 +43,7 @@
config = {
users.users =
(lib.mapAttrs (
_: v: lib.filterAttrs (n: _: !lib.elem n [ "isSystemUser" ]) v
_: v: lib.filterAttrs (n: _: !lib.elem n [ "name" "isSystemUser" ]) v
) config.nixos.users.users);
users.groups = config.nixos.users.groups;
};
Expand Down

0 comments on commit a03adca

Please sign in to comment.