From d37a3ea1efddb9667bb308d43e81a06286fe696b Mon Sep 17 00:00:00 2001 From: phaer Date: Mon, 2 Sep 2024 13:38:41 +0200 Subject: [PATCH] promox-image: use virtualisation.diskSize --- .../modules/virtualisation/proxmox-image.nix | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/nixos/modules/virtualisation/proxmox-image.nix b/nixos/modules/virtualisation/proxmox-image.nix index 4364fbff2a83..2cfc7fa1b530 100644 --- a/nixos/modules/virtualisation/proxmox-image.nix +++ b/nixos/modules/virtualisation/proxmox-image.nix @@ -6,8 +6,26 @@ }: with lib; - +let + virtualisationOptions = import ./virtualisation-options.nix; +in { + imports = [ + virtualisationOptions.diskSize + (lib.mkRenamedOptionModuleWith { + sinceRelease = 2411; + from = [ + "virtualisation" + "proxmoxImage" + "diskSize" + ]; + to = [ + "virtualisation" + "diskSize" + ]; + }) + ]; + options.proxmox = { qemuConf = { # essential configs @@ -95,16 +113,6 @@ with lib; either "efi" or "hybrid". ''; }; - diskSize = mkOption { - type = types.str; - default = "auto"; - example = "20480"; - description = '' - The size of the disk, in megabytes. - if "auto" size is calculated based on the contents copied to it and - additionalSpace is taken into account. - ''; - }; net0 = mkOption { type = types.commas; default = "virtio=00:00:00:00:00:00,bridge=vmbr0,firewall=1"; @@ -305,7 +313,8 @@ with lib; mkdir -p $out/nix-support echo "file vma $out/vzdump-qemu-${cfg.filenameSuffix}.vma.zst" > $out/nix-support/hydra-build-products ''; - inherit (cfg.qemuConf) additionalSpace diskSize bootSize; + inherit (cfg.qemuConf) additionalSpace bootSize; + inherit (config.virtualisation) diskSize; format = "raw"; inherit config lib pkgs; };