From 876ffab3b1f93332a72c1cd368c3b358e930f55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 12 Jan 2024 18:31:18 +0100 Subject: [PATCH] add option to orbit moons --- nixosModules/clanCore/zerotier/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nixosModules/clanCore/zerotier/default.nix b/nixosModules/clanCore/zerotier/default.nix index 19b10cf54..0ab85e7a3 100644 --- a/nixosModules/clanCore/zerotier/default.nix +++ b/nixosModules/clanCore/zerotier/default.nix @@ -73,6 +73,14 @@ in It will be reachable under the given stable endpoints. ''; }; + orbitMoons = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = '' + Join these moons. + This machine will be able to reach all machines in these moons. + ''; + }; }; subnet = lib.mkOption { type = lib.types.nullOr lib.types.str; @@ -171,6 +179,10 @@ in # Execute the command for each element ${pkgs.iproute2}/bin/ip link property add dev "$portDeviceName" altname "$name" done + + ${lib.concatMapStringsSep "\n" (moon: '' + zerotier-cli orbit ${moon} ${moon} + '') cfg.moon.orbitMoons} ''}" ];