about summary refs log tree commit diff
path: root/release.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-11 07:00:30 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-11 07:00:30 +0100
commitb4002136515ab1ab93f0be92902cd203f54e8fea (patch)
tree2f65317c86ea1dc2bf5ab323692d076fc3d2adc7 /release.nix
parent3c61dc3e6f47e95a86da9a152833c8d98e80f97f (diff)
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix10
1 files changed, 6 insertions, 4 deletions
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