about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-04-03 03:39:59 +0200
committeraszlig <aszlig@nix.build>2018-04-03 03:39:59 +0200
commit2cde2ae48b0e8c4cc2d73b4fd2e40c1a8a7006ad (patch)
treeeb416829aa72c748884f9f7f4b6edb4fdf175659
parent9b53e33ffcadf6f7cfaac4f1e4c8df2cdd736c90 (diff)
lib/call-network: Only use primops
After looking at that expression again, it turns out that we actually
don't even need to use __withPkgsPath, because all of the functionality
in there can be done using primops only.

Signed-off-by: aszlig <aszlig@nix.build>
-rw-r--r--lib/call-network.nix30
1 files changed, 12 insertions, 18 deletions
diff --git a/lib/call-network.nix b/lib/call-network.nix
index 509f34b9..f65b1156 100644
--- a/lib/call-network.nix
+++ b/lib/call-network.nix
@@ -1,24 +1,18 @@
 path: args:
 
 let
-  __withPkgsPath = nixpkgs: let
-    lib = import "${nixpkgs}/lib";
+  machineAttrs = import path;
+  machineNames = builtins.attrNames machineAttrs;
 
-    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" ]);
+  };
 
-    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;
-    };
+  machines = builtins.listToAttrs (map mkMachine machineNames);
 
-    machines = lib.listToAttrs (map mkMachine (lib.attrNames machineAttrs));
-
-  in machines;
-
-in __withPkgsPath (import ../nixpkgs-path.nix) // {
-  inherit __withPkgsPath;
-}
+in machines