From 10293b87a9da30631b49b11b56cd8a55dd3c7896 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 15 Mar 2016 13:48:45 +0100 Subject: [PATCH] Combine ISO generation steps This folds adding hydra-build-products into the actual ISO generation, preventing an unnecessary download of the ISO. --- nixos/lib/make-iso9660-image.nix | 3 +-- nixos/lib/make-iso9660-image.sh | 1 + nixos/release.nix | 30 +++++------------------------- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/nixos/lib/make-iso9660-image.nix b/nixos/lib/make-iso9660-image.nix index 21c9cca316d1..75be70dbcb2b 100644 --- a/nixos/lib/make-iso9660-image.nix +++ b/nixos/lib/make-iso9660-image.nix @@ -39,7 +39,6 @@ , # The volume ID. volumeID ? "" - }: assert bootable -> bootImage != ""; @@ -47,7 +46,7 @@ assert efiBootable -> efiBootImage != ""; assert usbBootable -> isohybridMbrImage != ""; stdenv.mkDerivation { - name = "iso9660-image"; + name = isoName; builder = ./make-iso9660-image.sh; buildInputs = [perl xorriso syslinux]; diff --git a/nixos/lib/make-iso9660-image.sh b/nixos/lib/make-iso9660-image.sh index 31bfe23d3d4a..c623436f6c5b 100644 --- a/nixos/lib/make-iso9660-image.sh +++ b/nixos/lib/make-iso9660-image.sh @@ -133,3 +133,4 @@ fi mkdir -p $out/nix-support echo $system > $out/nix-support/system +echo "file iso $out/iso/$isoName" >> $out/nix-support/hydra-build-products diff --git a/nixos/release.nix b/nixos/release.nix index b697ba4c5032..9d577a24b9e5 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -43,34 +43,14 @@ let makeIso = - { module, type, description ? type, maintainers ? ["eelco"], system }: + { module, type, maintainers ? ["eelco"], system }: with import nixpkgs { inherit system; }; - let - - config = (import lib/eval-config.nix { - inherit system; - modules = [ module versionModule { isoImage.isoBaseName = "nixos-${type}"; } ]; - }).config; - - iso = config.system.build.isoImage; - - in - # Declare the ISO as a build product so that it shows up in Hydra. - hydraJob (runCommand "nixos-iso-${config.system.nixosVersion}" - { meta = { - description = "NixOS installation CD (${description}) - ISO image for ${system}"; - maintainers = map (x: lib.maintainers.${x}) maintainers; - }; - inherit iso; - passthru = { inherit config; }; - preferLocalBuild = true; - } - '' - mkdir -p $out/nix-support - echo "file iso" $iso/iso/*.iso* >> $out/nix-support/hydra-build-products - ''); # */ + hydraJob ((import lib/eval-config.nix { + inherit system; + modules = [ module versionModule { isoImage.isoBaseName = "nixos-${type}"; } ]; + }).config.system.build.isoImage); makeSystemTarball =