Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let
- targetConfig = {
- test-cn-1 = {
- targetEnv = "none";
- targetHost = "192.168.1.232";
- };
- test-hv-1 = {
- targetEnv = "none";
- targetHost = "192.168.1.250";
- };
- };
- user_data = import ./config/users.nix;
- generateCnConfig = id: {
- name = "test-cn-${toString (id+1)}";
- value = { config, pkgs, lib, resources, ... }: {
- deployment = targetConfig."test-cn-${toString (id+1)}";
- imports = [ (./config + "/test-cn-${toString (id+1)}.nix") ./config/users.nix ];
- };
- };
- generateHvConfig = id: {
- name = "test-hv-${toString (id+1)}";
- value = { config, pkgs, lib, resources, ... }: {
- deployment = targetConfig."test-hv-${toString (id+1)}";
- imports = [ (./config + "/test-hv-${toString (id+1)}.nix") ./config/users.nix];
- };
- };
- cnServers = builtins.genList generateCnConfig 1;
- hvServers = builtins.genList generateHvConfig 1;
- in
- {
- network.description = "test";
- } // builtins.listToAttrs cnServers
- // builtins.listToAttrs hvServers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement