amazon-image: Add disk format option to image builder module

This commit is contained in:
Dan Peebles 2017-08-10 21:40:21 +00:00
parent b1ce017d44
commit f3f8c584a4

View File

@ -22,15 +22,20 @@ in {
generated image. Glob patterns work.
'';
};
format = mkOption {
type = types.enum [ "raw" "qcow2" ];
default = "qcow2";
description = "The image format to output";
};
};
config.system.build.amazonImage = import ../../../lib/make-disk-image.nix {
inherit lib config;
inherit (cfg) contents;
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;
format = "qcow2";
configFile = pkgs.writeText "configuration.nix"
''
{