summaryrefslogtreecommitdiffstats
path: root/nixos/modules/config/users-groups.nix
diff options
context:
space:
mode:
authorJoachim Schiele <js@lastlog.de>2018-03-08 20:46:11 +0100
committerRobin Gloster <mail@glob.in>2018-03-30 23:43:23 +0200
commit1b0cb040d9e44910edf8496f517d42c3878e9af2 (patch)
tree918170f34cb9ce17fb7a5cded9778f8822d8cff4 /nixos/modules/config/users-groups.nix
parent5de6ee22d1286b8b87b8dae56a1310f4b43af81e (diff)
user/group assertion to not exceed the 32 character limit
Diffstat (limited to 'nixos/modules/config/users-groups.nix')
-rw-r--r--nixos/modules/config/users-groups.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix
index 11e969b760e0..31435039e56d 100644
--- a/nixos/modules/config/users-groups.nix
+++ b/nixos/modules/config/users-groups.nix
@@ -35,6 +35,7 @@ let
name = mkOption {
type = types.str;
+ apply = x: assert (builtins.stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x;
description = ''
The name of the user account. If undefined, the name of the
attribute set will be used.
@@ -91,6 +92,7 @@ let
group = mkOption {
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";
description = "The user's primary group.";
};