From e13404895a46ef5416119d9bbe6a6a1d991b58ce Mon Sep 17 00:00:00 2001 From: Lucas Eduardo Date: Fri, 15 Jul 2022 06:45:25 -0300 Subject: [PATCH] nixos/label: add validation for system.nixos.label (#181479) Co-authored-by: Sandro --- nixos/modules/misc/label.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/label.nix b/nixos/modules/misc/label.nix index 02b91555b3c2..b97cbaa26304 100644 --- a/nixos/modules/misc/label.nix +++ b/nixos/modules/misc/label.nix @@ -11,7 +11,7 @@ in options.system = { nixos.label = mkOption { - type = types.str; + type = types.strMatching "[a-zA-Z0-9:_\\.-]*"; description = '' NixOS version name to be used in the names of generated outputs and boot labels. @@ -19,6 +19,9 @@ in If you ever wanted to influence the labels in your GRUB menu, this is the option for you. + It can only contain letters, numbers and the following symbols: + :, _, . and -. + The default is separated by "-" + "-" + NIXOS_LABEL_VERSION environment variable (defaults to the value of