openstack-image-zfs: sizeMB -> virt[...].diskSize

This commit is contained in:
phaer 2024-09-02 13:32:30 +02:00
parent a4b1638f7f
commit db8d63ba70

View File

@ -11,10 +11,25 @@ let
copyChannel = true;
cfg = config.openstackImage;
imageBootMode = if config.openstack.efi then "uefi" else "legacy-bios";
virtualisationOptions = import ../../../modules/virtualisation/virtualisation-options.nix;
in
{
imports = [
../../../modules/virtualisation/openstack-config.nix
virtualisationOptions.diskSize
(lib.mkRenamedOptionModuleWith {
sinceRelease = 2411;
from = [
"virtualisation"
"openstackImage"
"sizeMB"
];
to = [
"virtualisation"
"diskSize"
];
})
] ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix);
options.openstackImage = {
@ -30,12 +45,6 @@ in
description = "RAM allocation for build VM";
};
sizeMB = mkOption {
type = types.int;
default = 8192;
description = "The size in MB of the image";
};
format = mkOption {
type = types.enum [
"raw"
@ -61,6 +70,9 @@ in
};
};
virtualisation.diskSize = lib.mkDefault (8 * 1024);
virtualisation.diskSizeAutoSupported = false;
system.build.openstackImage = import ../../../lib/make-single-disk-zfs-image.nix {
inherit lib config;
inherit (cfg) contents format name;
@ -77,7 +89,7 @@ in
bootSize = 1000;
memSize = cfg.ramMB;
rootSize = cfg.sizeMB;
rootSize = config.virtualisation.diskSize;
rootPoolProperties = {
ashift = 12;
autoexpand = "on";