zerotier: Allow the controller to accept external Ips

Allow the controller to accept external zerotier Ips into the network
through declarative settings.

Closes:	#3787
This commit is contained in:
a-kenji
2025-06-05 17:50:59 +02:00
committed by kenji
parent cd4e39151d
commit 7b0ffe7e5c

View File

@@ -84,10 +84,26 @@
}; };
roles.controller = { roles.controller = {
interface =
{ lib, ... }:
{
options.allowedIps = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = ''
Extra machines by their zerotier ip that the zerotier controller
should accept. These could be external machines.
'';
example = ''
[ "fd5d:bbe3:cbc5:fe6b:f699:935d:bbe3:cbc5" ]
'';
};
};
perInstance = perInstance =
{ {
instanceName, instanceName,
roles, roles,
settings,
... ...
}: }:
{ {
@@ -133,7 +149,7 @@
else else
ips ips
) [ ] machines; ) [ ] machines;
allHostIPs = networkIps; allHostIPs = settings.allowedIps ++ networkIps;
in in
{ {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];