diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index 416b47b768d9..200c512ecf66 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -16,21 +16,28 @@ let ]; } ''; + virtualisationOptions = import ./virtualisation-options.nix; in { - imports = [ ./google-compute-config.nix ]; + imports = [ + ./google-compute-config.nix + virtualisationOptions.diskSize + (lib.mkRenamedOptionModuleWith { + sinceRelease = 2411; + from = [ + "virtualisation" + "googleComputeImage" + "diskSize" + ]; + to = [ + "virtualisation" + "diskSize" + ]; + }) + ]; options = { - virtualisation.googleComputeImage.diskSize = mkOption { - type = with types; either (enum [ "auto" ]) int; - default = "auto"; - example = 1536; - description = '' - Size of disk image. Unit is MB. - ''; - }; - virtualisation.googleComputeImage.configFile = mkOption { type = with types; nullOr str; default = null; @@ -86,7 +93,7 @@ in format = "raw"; configFile = if cfg.configFile == null then defaultConfigFile else cfg.configFile; partitionTableType = if cfg.efi then "efi" else "legacy"; - inherit (cfg) diskSize; + inherit (config.virtualisation) diskSize; inherit config lib pkgs; };