···
9
+
isPasswdCompatible = str: !(hasInfix ":" str || hasInfix "\n" str);
10
+
passwdEntry = type: lib.types.addCheck type isPasswdCompatible // {
11
+
name = "passwdEntry ${type.name}";
12
+
description = "${type.description}, not containing newlines or colons";
# Check whether a password hash will allow login.
hash == "" # login without password
···
63
+
type = passwdEntry types.str;
apply = x: assert (builtins.stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x;
The name of the user account. If undefined, the name of the
···
72
+
type = passwdEntry types.str;
example = "Alice Q. User";
···
137
+
type = passwdEntry types.path;
description = "The user's home directory.";
···
160
-
type = types.nullOr (types.either types.shellPackage types.path);
166
+
type = types.nullOr (types.either types.shellPackage (passwdEntry types.path));
defaultText = "pkgs.shadow";
example = literalExample "pkgs.bashInteractive";
···
hashedPassword = mkOption {
220
-
type = with types; nullOr str;
226
+
type = with types; nullOr (passwdEntry str);
Specifies the hashed password for the user.
···
initialHashedPassword = mkOption {
254
-
type = with types; nullOr str;
260
+
type = with types; nullOr (passwdEntry str);
Specifies the initial hashed password for the user, i.e. the
···
332
+
type = passwdEntry types.str;
The name of the group. If undefined, the name of the attribute set
···
343
-
type = with types; listOf str;
349
+
type = with types; listOf (passwdEntry str);
The user names of the group members, added to the