diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-04-10 12:12:56 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-04-10 12:12:56 +0200 |
commit | 1ab03c3a76dd142a44c27951018f145ff78fb57e (patch) | |
tree | 3b5d5847cddc04766e5a755a33bbcc0f0b9ab88c /nixos/modules/installer/cd-dvd/iso-image.nix | |
parent | 2e6fb229923cc2fd7275d26ea87f22898bdc24fa (diff) | |
parent | 807ca93fadd5197c2260490de0c76e500562dc05 (diff) |
Merge branch 'master' into staging-next
Diffstat (limited to 'nixos/modules/installer/cd-dvd/iso-image.nix')
-rw-r--r-- | nixos/modules/installer/cd-dvd/iso-image.nix | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 4558b4dc95521..5243a8aa747bf 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -417,8 +417,17 @@ in ''; }; + isoImage.edition = mkOption { + default = ""; + description = '' + Specifies which edition string to use in the volume ID of the generated + ISO image. + ''; + }; + isoImage.volumeID = mkOption { - default = "NIXOS_BOOT_CD"; + # nixos-$EDITION-$RELEASE-$ARCH + default = "nixos${optionalString (config.isoImage.edition != "") "-${config.isoImage.edition}"}-${config.system.nixos.release}-${pkgs.stdenv.hostPlatform.uname.processor}"; description = '' Specifies the label or volume ID of the generated ISO image. Note that the label is used by stage 1 of the boot process to @@ -515,6 +524,19 @@ in }; config = { + assertions = [ + { + assertion = !(stringLength config.isoImage.volumeID > 32); + # https://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor + # Volume Identifier can only be 32 bytes + message = let + length = stringLength config.isoImage.volumeID; + howmany = toString length; + toomany = toString (length - 32); + in + "isoImage.volumeID ${config.isoImage.volumeID} is ${howmany} characters. That is ${toomany} characters longer than the limit of 32."; + } + ]; boot.loader.grub.version = 2; |