mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 13:57:10 +03:00
amazon-image: make image size configurable
This commit is contained in:
parent
f40f4f5440
commit
5def5bab3c
@ -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 {
|
format = mkOption {
|
||||||
type = types.enum [ "raw" "qcow2" "vpc" ];
|
type = types.enum [ "raw" "qcow2" "vpc" ];
|
||||||
default = "qcow2";
|
default = "qcow2";
|
||||||
@ -35,7 +41,7 @@ in {
|
|||||||
inherit (cfg) contents format;
|
inherit (cfg) contents format;
|
||||||
pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
|
pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
|
||||||
partitioned = config.ec2.hvm;
|
partitioned = config.ec2.hvm;
|
||||||
diskSize = if config.ec2.hvm then 2048 else 8192;
|
diskSize = sizeMB;
|
||||||
configFile = pkgs.writeText "configuration.nix"
|
configFile = pkgs.writeText "configuration.nix"
|
||||||
''
|
''
|
||||||
{
|
{
|
||||||
@ -46,5 +52,4 @@ in {
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user