lol

nixos/modules/installer/sd-card: allow to customize volume label

+13 -2
+13 -2
nixos/modules/installer/sd-card/sd-image.nix
··· 26 26 inherit (config.sdImage) storePaths; 27 27 compressImage = config.sdImage.compressImage; 28 28 populateImageCommands = config.sdImage.populateRootCommands; 29 - volumeLabel = "NIXOS_SD"; 29 + volumeLabel = config.sdImage.rootVolumeLabel; 30 30 } 31 31 // optionalAttrs (config.sdImage.rootPartitionUUID != null) { 32 32 uuid = config.sdImage.rootPartitionUUID; ··· 117 117 ''; 118 118 }; 119 119 120 + rootVolumeLabel = mkOption { 121 + type = types.str; 122 + default = "NIXOS_SD"; 123 + example = "NIXOS_PENDRIVE"; 124 + description = '' 125 + Label for the NixOS root volume. 126 + Usually used when creating a recovery NixOS media installation 127 + that avoids conflicting with previous instalation label. 128 + ''; 129 + }; 130 + 120 131 firmwareSize = mkOption { 121 132 type = types.int; 122 133 # As of 2019-08-18 the Raspberry pi firmware + u-boot takes ~18MiB ··· 197 208 ]; 198 209 }; 199 210 "/" = { 200 - device = "/dev/disk/by-label/NIXOS_SD"; 211 + device = "/dev/disk/by-label/${config.sdImage.rootVolumeLabel}"; 201 212 fsType = "ext4"; 202 213 }; 203 214 };