···
map (range: "${user.name}:${toString range.startUid}:${toString range.count}\n")
339
-
subuidFile = concatStrings (map mkSubuidEntry (attrValues cfg.extraUsers));
339
+
subuidFile = concatStrings (map mkSubuidEntry (attrValues cfg.users));
mkSubgidEntry = user: concatStrings (
map (range: "${user.name}:${toString range.startGid}:${toString range.count}\n")
345
-
subgidFile = concatStrings (map mkSubgidEntry (attrValues cfg.extraUsers));
345
+
subgidFile = concatStrings (map mkSubgidEntry (attrValues cfg.users));
idsAreUnique = set: idAttr: !(fold (name: args@{ dup, acc }:
···
else { dup = false; acc = newAcc; }
) { dup = false; acc = {}; } (builtins.attrNames set)).dup;
357
-
uidsAreUnique = idsAreUnique (filterAttrs (n: u: u.uid != null) cfg.extraUsers) "uid";
358
-
gidsAreUnique = idsAreUnique (filterAttrs (n: g: g.gid != null) cfg.extraGroups) "gid";
357
+
uidsAreUnique = idsAreUnique (filterAttrs (n: u: u.uid != null) cfg.users) "uid";
358
+
gidsAreUnique = idsAreUnique (filterAttrs (n: g: g.gid != null) cfg.groups) "gid";
spec = pkgs.writeText "users-groups.json" (builtins.toJSON {
inherit (cfg) mutableUsers;
···
name uid group description home shell createHome isSystemUser
password passwordFile hashedPassword
initialPassword initialHashedPassword;
groups = mapAttrsToList (n: g:
members = g.members ++ (mapAttrsToList (n: u: u.name) (
371
-
filterAttrs (n: u: elem g.name u.extraGroups) cfg.extraUsers
371
+
filterAttrs (n: u: elem g.name u.extraGroups) cfg.users
373
-
}) cfg.extraGroups;
···
<literal>groupadd</literal> commands. On system activation, the
existing contents of the <literal>/etc/passwd</literal> and
<literal>/etc/group</literal> files will be merged with the
391
-
contents generated from the <literal>users.extraUsers</literal> and
392
-
<literal>users.extraGroups</literal> options.
391
+
contents generated from the <literal>users.users</literal> and
392
+
<literal>users.groups</literal> options.
The initial password for a user will be set
394
-
according to <literal>users.extraUsers</literal>, but existing passwords
394
+
according to <literal>users.users</literal>, but existing passwords
···
group files will simply be replaced on system activation. This also
holds for the user passwords; all changed
passwords will be reset according to the
402
-
<literal>users.extraUsers</literal> configuration on activation.
402
+
<literal>users.users</literal> configuration on activation.
···
415
-
users.extraUsers = mkOption {
415
+
users.users = mkOption {
type = types.loaOf types.optionSet;
···
436
-
users.extraGroups = mkOption {
436
+
users.groups = mkOption {
···
464
-
users.extraUsers = {
description = "System administrator";
···
481
-
users.extraGroups = {
root.gid = ids.gids.root;
wheel.gid = ids.gids.wheel;
disk.gid = ids.gids.disk;
···
|| cfg.passwordFile != null
|| cfg.openssh.authorizedKeys.keys != []
|| cfg.openssh.authorizedKeys.keyFiles != [])
Neither the root account nor any wheel user has a password or SSH authorized key.
You must set one to prevent being locked out of your system.'';