From a3b9a4f08ec836336fbd0070c6523dd5c6f4827b Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 3 May 2016 02:08:17 +0200 Subject: Move callMachines into lib/ We now no longer need to import the call-machine.nix directly but now can use import in order to get *both* the callMachine and the callMachines function. Signed-off-by: aszlig --- lib/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/default.nix (limited to 'lib/default.nix') diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 00000000..30661328 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,15 @@ +rec { + callMachine = import ./call-machine.nix; + + callMachines = 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)); +} -- cgit 1.4.1