treewide: use auto diskSize for make-disk-image

(cherry picked from commit f3aa040bcbf39935e7e9ac7a7296eac9da7623ec)

lassulus 5aa4273e ba666011

-1
nixos/maintainers/scripts/cloudstack/cloudstack-image.nix
···
system.build.cloudstackImage = import ../../../lib/make-disk-image.nix {
inherit lib config pkgs;
-
diskSize = 8192;
format = "qcow2";
configFile = pkgs.writeText "configuration.nix"
''
···
system.build.cloudstackImage = import ../../../lib/make-disk-image.nix {
inherit lib config pkgs;
format = "qcow2";
configFile = pkgs.writeText "configuration.nix"
''
+3 -2
nixos/maintainers/scripts/ec2/amazon-image.nix
···
};
sizeMB = mkOption {
-
type = types.int;
-
default = if config.ec2.hvm then 2048 else 8192;
description = "The size in MB of the image";
};
···
};
sizeMB = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 8192;
description = "The size in MB of the image";
};
+1 -1
nixos/maintainers/scripts/openstack/openstack-image.nix
···
system.build.openstackImage = import ../../../lib/make-disk-image.nix {
inherit lib config;
pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
-
diskSize = 8192;
format = "qcow2";
configFile = pkgs.writeText "configuration.nix"
''
···
system.build.openstackImage = import ../../../lib/make-disk-image.nix {
inherit lib config;
+
additionalSpace = "1024M";
pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
format = "qcow2";
configFile = pkgs.writeText "configuration.nix"
''
+3 -2
nixos/modules/virtualisation/azure-image.nix
···
options = {
virtualisation.azureImage.diskSize = mkOption {
-
type = with types; int;
-
default = 2048;
description = ''
Size of disk image. Unit is MB.
'';
···
options = {
virtualisation.azureImage.diskSize = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 2048;
description = ''
Size of disk image. Unit is MB.
'';
+3 -2
nixos/modules/virtualisation/digital-ocean-image.nix
···
options = {
virtualisation.digitalOceanImage.diskSize = mkOption {
-
type = with types; int;
-
default = 4096;
description = ''
Size of disk image. Unit is MB.
'';
···
options = {
virtualisation.digitalOceanImage.diskSize = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 4096;
description = ''
Size of disk image. Unit is MB.
'';
+3 -2
nixos/modules/virtualisation/google-compute-image.nix
···
options = {
virtualisation.googleComputeImage.diskSize = mkOption {
-
type = with types; int;
-
default = 1536;
description = ''
Size of disk image. Unit is MB.
'';
···
options = {
virtualisation.googleComputeImage.diskSize = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 1536;
description = ''
Size of disk image. Unit is MB.
'';
+3 -2
nixos/modules/virtualisation/hyperv-image.nix
···
options = {
hyperv = {
baseImageSize = mkOption {
-
type = types.int;
-
default = 2048;
description = ''
The size of the hyper-v base image in MiB.
'';
···
options = {
hyperv = {
baseImageSize = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 2048;
description = ''
The size of the hyper-v base image in MiB.
'';
+3 -2
nixos/modules/virtualisation/virtualbox-image.nix
···
options = {
virtualbox = {
baseImageSize = mkOption {
-
type = types.int;
-
default = 50 * 1024;
description = ''
The size of the VirtualBox base image in MiB.
'';
···
options = {
virtualbox = {
baseImageSize = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 50 * 1024;
description = ''
The size of the VirtualBox base image in MiB.
'';
+3 -2
nixos/modules/virtualisation/vmware-image.nix
···
options = {
vmware = {
baseImageSize = mkOption {
-
type = types.int;
-
default = 2048;
description = ''
The size of the VMWare base image in MiB.
'';
···
options = {
vmware = {
baseImageSize = mkOption {
+
type = with types; either (enum [ "auto" ]) int;
+
default = "auto";
+
example = 2048;
description = ''
The size of the VMWare base image in MiB.
'';