Auto reconnect tailscale on auth key change

This commit is contained in:
SebastianStork 2024-06-20 11:27:28 +02:00
parent 433ab8d024
commit 4e3d826c14

View file

@ -10,14 +10,13 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
sops.secrets.tailscale-auth-key = { }; sops.secrets.tailscale-auth-key.restartUnits = [ "tailscaled-autoconnect.service" ];
services.tailscale = { services.tailscale = {
enable = true; enable = true;
authKeyFile = config.sops.secrets.tailscale-auth-key.path; authKeyFile = config.sops.secrets.tailscale-auth-key.path;
openFirewall = true; openFirewall = true;
permitCertUid = "root";
useRoutingFeatures = if cfg.exitNode.enable then "server" else "client"; useRoutingFeatures = if cfg.exitNode.enable then "server" else "client";
extraUpFlags = [ extraUpFlags = [