nixos/label: add validation for system.nixos.label (#181479)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Lucas Eduardo 2022-07-15 06:45:25 -03:00 committed by GitHub
parent baeefadb54
commit e13404895a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:
<literal>:</literal>, <literal>_</literal>, <literal>.</literal> and <literal>-</literal>.
The default is <option>system.nixos.tags</option> separated by
"-" + "-" + <envar>NIXOS_LABEL_VERSION</envar> environment
variable (defaults to the value of