3
0
Fork 0
forked from mirrors/nixpkgs

amazon-image: make derivation name configurable

I'm getting dozens of nixos-disk-image entries in my store and it's
getting hard to track :)
This commit is contained in:
Dan Peebles 2017-10-23 16:22:16 -04:00
parent bb49391151
commit 63f7456f6a

View file

@ -9,6 +9,12 @@ in {
imports = [ ../../../modules/virtualisation/amazon-image.nix ]; imports = [ ../../../modules/virtualisation/amazon-image.nix ];
options.amazonImage = { options.amazonImage = {
name = mkOption {
type = types.str;
description = "The name of the generated derivation";
default = "nixos-disk-image";
};
contents = mkOption { contents = mkOption {
example = literalExample '' example = literalExample ''
[ { source = pkgs.memtest86 + "/memtest.bin"; [ { source = pkgs.memtest86 + "/memtest.bin";
@ -38,7 +44,7 @@ in {
config.system.build.amazonImage = import ../../../lib/make-disk-image.nix { config.system.build.amazonImage = import ../../../lib/make-disk-image.nix {
inherit lib config; inherit lib config;
inherit (cfg) contents format; inherit (cfg) contents format name;
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 = cfg.sizeMB; diskSize = cfg.sizeMB;