diff --git a/clanModules/zerotier/roles/controller.nix b/clanModules/zerotier/roles/controller.nix index 27dd01d6d..b364f76d6 100644 --- a/clanModules/zerotier/roles/controller.nix +++ b/clanModules/zerotier/roles/controller.nix @@ -9,7 +9,8 @@ let instanceName = builtins.head instanceNames; zeroTierInstance = config.clan.inventory.services.zerotier.${instanceName}; roles = zeroTierInstance.roles; - stringSet = list: builtins.attrNames (builtins.groupBy lib.id list); + # TODO(@mic92): This should be upstreamed to nixpkgs + uniqueStrings = list: builtins.attrNames (builtins.groupBy lib.id list); in { imports = [ @@ -18,7 +19,7 @@ in config = { systemd.services.zerotier-inventory-autoaccept = let - machines = stringSet (roles.moon.machines ++ roles.controller.machines ++ roles.peer.machines); + machines = uniqueStrings (roles.moon.machines ++ roles.controller.machines ++ roles.peer.machines); networkIps = builtins.foldl' ( ips: name: if builtins.pathExists "${config.clan.core.clanDir}/machines/${name}/facts/zerotier-ip" then diff --git a/inventory.json b/inventory.json index 8a8fe11ed..ebc3ec114 100644 --- a/inventory.json +++ b/inventory.json @@ -16,6 +16,15 @@ } }, "services": { + "zerotier": { + "1": { + "roles": { + "controller": { + "machines": ["test-inventory-machine"] + } + } + } + }, "borgbackup": { "simple": { "roles": {