2015-09-27 20:01:43 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
imports =
|
|
|
|
[ ../../../modules/installer/cd-dvd/channel.nix
|
|
|
|
../../../modules/virtualisation/amazon-image.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
system.build.amazonImage = import ../../../lib/make-disk-image.nix {
|
2016-03-30 20:48:12 +01:00
|
|
|
inherit lib config;
|
|
|
|
pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
|
2015-09-27 20:01:43 +01:00
|
|
|
partitioned = config.ec2.hvm;
|
2015-09-28 19:24:27 +01:00
|
|
|
diskSize = if config.ec2.hvm then 2048 else 8192;
|
2016-03-30 20:48:12 +01:00
|
|
|
format = "qcow2";
|
2015-09-27 20:01:43 +01:00
|
|
|
configFile = pkgs.writeText "configuration.nix"
|
|
|
|
''
|
|
|
|
{
|
|
|
|
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
|
|
|
|
${optionalString config.ec2.hvm ''
|
|
|
|
ec2.hvm = true;
|
|
|
|
''}
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|