Skip to content

Commit

Permalink
amazon-image: make image size configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
copumpkin committed Aug 11, 2017
1 parent f40f4f5 commit 5def5ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nixos/maintainers/scripts/ec2/amazon-image.nix
Expand Up @@ -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";
Expand All @@ -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"
''
{
Expand All @@ -46,5 +52,4 @@ in {
}
'';
};

}

0 comments on commit 5def5ba

Please sign in to comment.