From 5def5bab3c948944c75eba224a76a32559d5c6fc Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Fri, 11 Aug 2017 01:57:38 +0000 Subject: [PATCH] amazon-image: make image size configurable --- nixos/maintainers/scripts/ec2/amazon-image.nix | 9 +++++++-- 1 file 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 { } ''; }; - }