about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/call-machine.nix6
-rw-r--r--lib/call-network.nix31
-rw-r--r--release.nix5
3 files changed, 24 insertions, 18 deletions
diff --git a/lib/call-machine.nix b/lib/call-machine.nix
index 8c50ce16..f500dd21 100644
--- a/lib/call-machine.nix
+++ b/lib/call-machine.nix
@@ -1,7 +1,7 @@
 path: cfg:
 
 let
-  withPkgsPath = nixpkgs: rec {
+  __withPkgsPath = nixpkgs: rec {
     eval = import "${nixpkgs}/nixos/lib/eval-config.nix" {
       modules = [ path cfg ] ++ import ../modules/module-list.nix;
     };
@@ -63,11 +63,11 @@ let
   };
 
 in rec {
-  inherit (withPkgsPath (import ../nixpkgs-path.nix))
+  inherit (__withPkgsPath (import ../nixpkgs-path.nix))
     build config eval iso installerIso vm;
 
   # This is internal only and for use with restricted evaluation mode in Hydra
   # to get the path to nixpkgs from the jobset input args instead of
   # ../nixpkgs-path.nix.
-  inherit withPkgsPath;
+  inherit __withPkgsPath;
 }
diff --git a/lib/call-network.nix b/lib/call-network.nix
index 6b621357..509f34b9 100644
--- a/lib/call-network.nix
+++ b/lib/call-network.nix
@@ -1,19 +1,24 @@
 path: args:
 
-with import "${import ../nixpkgs-path.nix}/lib";
-
 let
-  machineAttrs = import path;
+  __withPkgsPath = nixpkgs: let
+    lib = import "${nixpkgs}/lib";
+
+    machineAttrs = import path;
+
+    mkMachine = name: {
+      inherit name;
+      value = (import ./call-machine.nix machineAttrs.${name} ({ lib, ... }: {
+        imports = lib.singleton (args.extraConfig or {});
+        networking.hostName = lib.mkOverride 900 name;
+        _module.args.nodes = lib.mapAttrs (lib.const (m: m ? eval)) machines;
+      } // removeAttrs args [ "extraConfig" ])).__withPkgsPath nixpkgs;
+    };
 
-  mkMachine = name: {
-    inherit name;
-    value = import ./call-machine.nix machineAttrs.${name} ({ lib, ... }: {
-      imports = lib.singleton (args.extraConfig or {});
-      networking.hostName = lib.mkOverride 900 name;
-      _module.args.nodes = mapAttrs (const (m: m ? eval)) machines;
-    } // removeAttrs args [ "extraConfig" ]);
-  };
+    machines = lib.listToAttrs (map mkMachine (lib.attrNames machineAttrs));
 
-  machines = listToAttrs (map mkMachine (attrNames machineAttrs));
+  in machines;
 
-in machines
+in __withPkgsPath (import ../nixpkgs-path.nix) // {
+  inherit __withPkgsPath;
+}
diff --git a/release.nix b/release.nix
index 46e1edf2..e55b45fa 100644
--- a/release.nix
+++ b/release.nix
@@ -40,8 +40,9 @@ let
   mpath = if vuizvuiSrc == null then ./machines else "${vuizvui}/machines";
 
   allMachines = with pkgsUpstream.lib; let
-    wrapPkgs = machine: machine.withPkgsPath nixpkgs;
-  in mapAttrsRecursiveCond (m: !(m ? eval)) (const wrapPkgs) (import mpath);
+    wrapPkgs = machine: machine.__withPkgsPath nixpkgs;
+    condition = m: !(m ? __withPkgsPath);
+  in mapAttrsRecursiveCond condition (const wrapPkgs) (import mpath);
 
   allTests = with import ./lib; getVuizvuiTests ({
     inherit system nixpkgs;