about summary refs log tree commit diff
path: root/lib/call-network.nix
blob: 509f34b9de0bdb8d122777199e4e6b513103d788 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
path: args:

let
  __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;
    };

    machines = lib.listToAttrs (map mkMachine (lib.attrNames machineAttrs));

  in machines;

in __withPkgsPath (import ../nixpkgs-path.nix) // {
  inherit __withPkgsPath;
}