From b4002136515ab1ab93f0be92902cd203f54e8fea Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 11 Dec 2015 07:00:30 +0100 Subject: release.nix: Only import machines once. This removes a bit of redundant code and also makes instantiation with --eval-only a bit more convenient, because we're testing whether we have vuizvuiSrc and if not we're importing a plain path directly. Signed-off-by: aszlig --- release.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'release.nix') diff --git a/release.nix b/release.nix index 5245e267..b666ae67 100644 --- a/release.nix +++ b/release.nix @@ -37,14 +37,16 @@ let pkgsUpstream = import nixpkgs { inherit system; }; root = import vuizvui { inherit system; }; + mpath = if vuizvuiSrc == null then ./machines else "${vuizvui}/machines"; + allMachines = import mpath { inherit system; }; + in with pkgsUpstream.lib; with builtins; { machines = mapAttrsRecursiveCond (m: !(m ? build)) (path: attrs: attrs.build.config.system.build.toplevel - ) (import "${vuizvui}/machines" { inherit system; }); + ) allMachines; isoImages = let - machineBase = import "${vuizvui}/machines" { inherit system; }; buildIso = attrs: let name = attrs.iso.config.networking.hostName; cond = attrs.iso.config.vuizvui.createISO; @@ -57,7 +59,7 @@ in with pkgsUpstream.lib; with builtins; { echo "file iso" $iso/iso/*.iso* \ >> "$out/nix-support/hydra-build-products" ''; - in mapAttrsRecursiveCond (m: !(m ? iso)) (const buildIso) machineBase; + in mapAttrsRecursiveCond (m: !(m ? iso)) (const buildIso) allMachines; tests = mapAttrsRecursiveCond (t: !(t ? test)) (const id) (import "${vuizvui}/tests" { inherit system; }); @@ -85,7 +87,7 @@ in with pkgsUpstream.lib; with builtins; { name = "machine-${last path}"; constituents = singleton attrs.build.config.system.build.toplevel ++ attrs.build.config.vuizvui.requiresTests; - }) (import "${vuizvui}/machines" { inherit system; }); + }) allMachines; }; manual = let -- cgit 1.4.1