diff --git a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix index 72f123b16229..ffce6deed6e0 100644 --- a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix +++ b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix @@ -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";