diff options
author | Dan Peebles <pumpkin@me.com> | 2017-08-11 01:57:38 +0000 |
---|---|---|
committer | Dan Peebles <pumpkin@me.com> | 2017-08-11 01:57:43 +0000 |
commit | 5def5bab3c948944c75eba224a76a32559d5c6fc (patch) | |
tree | fd26a0b9c3fb0a421f2c7f550e924a0c16cf3c56 /nixos/maintainers/scripts | |
parent | f40f4f5440ba438f9e0c43a804849f174f43c80b (diff) |
amazon-image: make image size configurable
Diffstat (limited to 'nixos/maintainers/scripts')
-rw-r--r-- | nixos/maintainers/scripts/ec2/amazon-image.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nixos/maintainers/scripts/ec2/amazon-image.nix b/nixos/maintainers/scripts/ec2/amazon-image.nix index 955fdff7953..9756aebe7f2 100644 --- a/nixos/maintainers/scripts/ec2/amazon-image.nix +++ b/nixos/maintainers/scripts/ec2/amazon-image.nix @@ -23,6 +23,12 @@ in { ''; }; + sizeMB = mkOption { + type = types.int; + default = if config.ec2.hvm then 2048 else 8192; + description = "The size in MB of the image"; + }; + format = mkOption { type = types.enum [ "raw" "qcow2" "vpc" ]; default = "qcow2"; @@ -35,7 +41,7 @@ in { inherit (cfg) contents format; pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package partitioned = config.ec2.hvm; - diskSize = if config.ec2.hvm then 2048 else 8192; + diskSize = sizeMB; configFile = pkgs.writeText "configuration.nix" '' { @@ -46,5 +52,4 @@ in { } ''; }; - } |