all repos — nixfiles @ 933848c0e142f18579fe6962db2d3440ea65d3f3

System and user configuration, managed by nix and home-manager

tailscale-subnet-router: fix flag generation

Alin
commit

933848c0e142f18579fe6962db2d3440ea65d3f3

parent

67f7c6a4685cc0af25a76195c8e9d02ecc18dae1

1 file changed, 9 insertions(+), 12 deletions(-)

changed files
M system/roles/tailscale-subnet-router.nix → system/roles/tailscale-subnet-router.nix
@@ -5,15 +5,11 @@ ...
}: let lan = builtins.head config.networking.nat.internalInterfaces; - withArg = - arg: list: - if list == [ ] || builtins.length list == 1 then - list - else - lib.concatMap (x: [ - arg - x - ]) list; + + networks = [ + "10.0.0.0/16" + "fd12:d04f:65d::/56" + ]; in { networking.firewall.extraForwardRules = ''
@@ -21,7 +17,8 @@ iifname "tailscale0" oifname "${lan}" accept
iifname "${lan}" oifname "tailscale0" accept ''; - services.tailscale.extraSetFlags = - withArg "--advertise-routes" - config.systemd.network.networks."40-${lan}".address; + services.tailscale.extraSetFlags = [ + "--advertise-routes" + (lib.join "," networks) + ]; }