amazon-image: make image size configurable
This commit is contained in:
parent
f40f4f5440
commit
5def5bab3c
1 changed files with 7 additions and 2 deletions
|
@ -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 {
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue