about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-05-03 02:19:41 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-05-03 02:49:49 +0200
commitdccee5cecb6bd7b7e369cab99eb78006879c41e9 (patch)
tree28cafd66dd93832bb853b634820db6b5b63cfbb7 /lib
parent76da82197f6cb49c7cbc4fa0d534489a358b9f74 (diff)
lib: Move callNetwork into its own file
Just to keep the default.nix clean and easy to read.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/call-network.nix15
-rw-r--r--lib/default.nix14
2 files changed, 16 insertions, 13 deletions
diff --git a/lib/call-network.nix b/lib/call-network.nix
new file mode 100644
index 00000000..dac125e7
--- /dev/null
+++ b/lib/call-network.nix
@@ -0,0 +1,15 @@
+path: args:
+
+with builtins;
+
+let
+  machines = import path;
+in listToAttrs (map (name: {
+  inherit name;
+  value = import ./call-machine.nix machines.${name} ({
+    extraConfig = { lib, ... }: {
+      imports = lib.singleton (args.extraConfig or {});
+      networking.hostName = lib.mkOverride 900 name;
+    };
+  } // removeAttrs args [ "extraConfig" ]);
+}) (attrNames machines))
diff --git a/lib/default.nix b/lib/default.nix
index 2c211f6f..05118275 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,17 +1,5 @@
 rec {
   callMachine = import ./call-machine.nix;
-
-  callNetwork = path: args: let
-    machines = import path;
-  in with builtins; listToAttrs (map (name: {
-    inherit name;
-    value = callMachine machines.${name} ({
-      extraConfig = { lib, ... }: {
-        imports = lib.singleton (args.extraConfig or {});
-        networking.hostName = lib.mkOverride 900 name;
-      };
-    } // removeAttrs args [ "extraConfig" ]);
-  }) (attrNames machines));
-
+  callNetwork = import ./call-network.nix;
   getVuizvuiTests = import ./get-tests.nix;
 }