user/group assertion to not exceed the 32 character limit

This commit is contained in:
Joachim Schiele 2018-03-08 20:46:11 +01:00 committed by Robin Gloster
parent 5de6ee22d1
commit 1b0cb040d9

View File

@ -35,6 +35,7 @@ let
name = mkOption { name = mkOption {
type = types.str; type = types.str;
apply = x: assert (builtins.stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x;
description = '' description = ''
The name of the user account. If undefined, the name of the The name of the user account. If undefined, the name of the
attribute set will be used. attribute set will be used.
@ -91,6 +92,7 @@ let
group = mkOption { group = mkOption {
type = types.str; type = types.str;
apply = x: assert (builtins.stringLength x < 17 || abort "Group name '${x}' is longer than 16 characters which is not allowed!"); x;
default = "nogroup"; default = "nogroup";
description = "The user's primary group."; description = "The user's primary group.";
}; };