about summary refs log tree commit diff
path: root/lib/call-network.nix
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/call-network.nix
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/call-network.nix')
-rw-r--r--lib/call-network.nix15
1 files changed, 15 insertions, 0 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))