From e98d9116388d27fb01b81c43cd14f3867c53daf0 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Mon, 13 May 2024 13:16:20 -0700 Subject: [PATCH] chore(tailscale): minor cleanup --- nixos/tailscale.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/tailscale.nix b/nixos/tailscale.nix index d686ca49..cefc68d4 100644 --- a/nixos/tailscale.nix +++ b/nixos/tailscale.nix @@ -12,11 +12,11 @@ in { }; config = { networking.firewall = { - trustedInterfaces = [config.services.tailscale.interfaceName]; - allowedUDPPorts = [config.services.tailscale.port]; + trustedInterfaces = [cfg.interfaceName]; + allowedUDPPorts = [cfg.port]; }; systemd.network = { - wait-online.ignoredInterfaces = [config.services.tailscale.interfaceName]; + wait-online.ignoredInterfaces = [cfg.interfaceName]; networks."50-tailscale" = { networkConfig = { DNSDefaultRoute = false; @@ -27,8 +27,8 @@ in { services.tailscale.enable = mkDefault true; - sops.secrets.tailscale-key = mkIf config.services.tailscale.enable {}; - systemd.services.tailscale-autoconnect = mkIf config.services.tailscale.enable rec { + sops.secrets.tailscale-key = mkIf cfg.enable {}; + systemd.services.tailscale-autoconnect = mkIf cfg.enable rec { description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale @@ -44,7 +44,7 @@ in { # have the job run this shell script script = let fixResolved = optionalString config.services.resolved.enable '' - resolvectl revert ${config.services.tailscale.interfaceName} || true + resolvectl revert ${cfg.interfaceName} || true ''; # https://tailscale.com/kb/1320/performance-best-practices#ethtool-configuration exitNodeRouting = optionalString cfg.advertiseExitNode ''