3
0
Fork 0
forked from mirrors/nixpkgs

amazon-image.nix: add hydra-build-products and improve metadata

This commit is contained in:
Andrew Childs 2019-06-01 04:19:18 +09:00
parent 9898fd0e8e
commit 25bee972e9

View file

@ -17,7 +17,7 @@ in {
name = mkOption {
type = types.str;
description = "The name of the generated derivation";
default = "nixos-disk-image";
default = "nixos-amazon-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
};
contents = mkOption {
@ -68,5 +68,14 @@ in {
''}
}
'';
postVM = ''
extension=''${diskImage##*.}
friendlyName=$out/${cfg.name}.$extension
mv "$diskImage" "$friendlyName"
diskImage=$friendlyName
mkdir -p $out/nix-support
echo "file ${cfg.format} $diskImage" >> $out/nix-support/hydra-build-products
'';
};
}