image/repart: add image.repart.imageSize for --size (#463697)

This commit is contained in:
nikstur
2025-11-29 19:12:50 +00:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
+2 -1
View File
@@ -37,6 +37,7 @@
split,
seed,
definitionsDirectory,
imageSize ? "auto",
sectorSize,
mkfsEnv ? { },
createEmpty ? true,
@@ -170,7 +171,7 @@ stdenvNoCC.mkDerivation (
systemdRepartFlags = [
"--architecture=${systemdArch}"
"--dry-run=no"
"--size=auto"
"--size=${imageSize}"
"--definitions=${finalAttrs.finalRepartDefinitions}"
"--split=${lib.boolToString split}"
"--json=pretty"
+9
View File
@@ -201,6 +201,14 @@ in
'';
};
imageSize = lib.mkOption {
type = lib.types.strMatching "^([0-9]+[KMGTP]?|auto)$";
default = "auto";
example = "512G";
description = "Size of the produced image in bytes with optional K, M, G, T suffix,
or 'auto' to determine the minimal size automatically";
};
package = lib.mkPackageOption pkgs "systemd-repart" {
# We use buildPackages so that repart images are built with the build
# platform's systemd, allowing for cross-compiled systems to work.
@@ -415,6 +423,7 @@ in
compression
split
seed
imageSize
sectorSize
finalPartitions
;