nixos/installer: add option to override the root filesystem image creator itself

allows overriding the process how the filesystem image is created which the resulting sd-card image will use.
This commit is contained in:
Jan B.
2025-09-12 14:01:46 +02:00
committed by Jan Braun
parent 0d896304de
commit f5ae72b1c1

View File

@@ -142,6 +142,15 @@ in
'';
};
rootFilesystemImage = mkOption {
type = types.package;
default = rootfsImage;
description = ''
The finished root partition image with all custom fileystem modifications.
Used to override the filesystem creator itself.
'';
};
firmwareSize = mkOption {
type = types.int;
# As of 2019-08-18 the Raspberry pi firmware + u-boot takes ~18MiB
@@ -268,11 +277,11 @@ in
echo "file sd-image $img" >> $out/nix-support/hydra-build-products
fi
root_fs=${rootfsImage}
root_fs=${config.sdImage.rootFilesystemImage}
${lib.optionalString config.sdImage.compressImage ''
root_fs=./root-fs.img
echo "Decompressing rootfs image"
zstd -d --no-progress "${rootfsImage}" -o $root_fs
zstd -d --no-progress "${config.sdImage.rootFilesystemImage}" -o $root_fs
''}
# Gap in front of the first partition, in MiB