nixos/installer/sd-card: add rootVolumeLabel option (#343003)
This commit is contained in:
commit
8e33818f56
@ -26,7 +26,7 @@ let
|
|||||||
inherit (config.sdImage) storePaths;
|
inherit (config.sdImage) storePaths;
|
||||||
compressImage = config.sdImage.compressImage;
|
compressImage = config.sdImage.compressImage;
|
||||||
populateImageCommands = config.sdImage.populateRootCommands;
|
populateImageCommands = config.sdImage.populateRootCommands;
|
||||||
volumeLabel = "NIXOS_SD";
|
volumeLabel = config.sdImage.rootVolumeLabel;
|
||||||
}
|
}
|
||||||
// optionalAttrs (config.sdImage.rootPartitionUUID != null) {
|
// optionalAttrs (config.sdImage.rootPartitionUUID != null) {
|
||||||
uuid = config.sdImage.rootPartitionUUID;
|
uuid = config.sdImage.rootPartitionUUID;
|
||||||
@ -117,6 +117,17 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rootVolumeLabel = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "NIXOS_SD";
|
||||||
|
example = "NIXOS_PENDRIVE";
|
||||||
|
description = ''
|
||||||
|
Label for the NixOS root volume.
|
||||||
|
Usually used when creating a recovery NixOS media installation
|
||||||
|
that avoids conflicting with previous instalation label.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
firmwareSize = mkOption {
|
firmwareSize = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
# As of 2019-08-18 the Raspberry pi firmware + u-boot takes ~18MiB
|
# As of 2019-08-18 the Raspberry pi firmware + u-boot takes ~18MiB
|
||||||
@ -197,7 +208,7 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-label/NIXOS_SD";
|
device = "/dev/disk/by-label/${config.sdImage.rootVolumeLabel}";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user