git.iko.soy/typeable/nixpkgs
on master help sign in
amazon-image: make image size configurable
commit5def5bab3c948944c75eba224a76a32559d5c6fc authorDan Peebles <pumpkin@me.com> dateFri 11 Aug 2017, 01:57 (9 years ago) parentf40f4f5
1 file changed+7−2
nixos/maintainers/scripts/ec2/amazon-image.nix+7−2
nixos/maintainers/scripts/ec2/amazon-image.nix+7−2
@@ -23,6 +23,12 @@ in {
2323 '';
2424 };
2525
26+ sizeMB = mkOption {
27+ type = types.int;
28+ default = if config.ec2.hvm then 2048 else 8192;
29+ description = "The size in MB of the image";
30+ };
31+
2632 format = mkOption {
2733 type = types.enum [ "raw" "qcow2" "vpc" ];
2834 default = "qcow2";
@@ -35,7 +41,7 @@ in {
3541 inherit (cfg) contents format;
3642 pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
3743 partitioned = config.ec2.hvm;
38− diskSize = if config.ec2.hvm then 2048 else 8192;
44+ diskSize = sizeMB;
3945 configFile = pkgs.writeText "configuration.nix"
4046 ''
4147 {
@@ -46,5 +52,4 @@ in {
4652 }
4753 '';
4854 };
49−
5055}