From 3b8a1626800c6ddf0cfc8fdf4b8acd34f4401224 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 21 Jun 2022 13:23:28 -0700 Subject: [PATCH] tailscale: ignore tailscale link when using networkd --- nixos/modules/services/networking/tailscale.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/modules/services/networking/tailscale.nix b/nixos/modules/services/networking/tailscale.nix index 0133874d0e0d..f84252289abf 100644 --- a/nixos/modules/services/networking/tailscale.nix +++ b/nixos/modules/services/networking/tailscale.nix @@ -6,6 +6,7 @@ let cfg = config.services.tailscale; firewallOn = config.networking.firewall.enable; rpfMode = config.networking.firewall.checkReversePath; + isNetworkd = config.networking.useNetworkd; rpfIsStrict = rpfMode == true || rpfMode == "strict"; in { meta.maintainers = with maintainers; [ danderson mbaillie twitchyliquid64 ]; @@ -69,5 +70,17 @@ in { # linux distros. stopIfChanged = false; }; + + networking.dhcpcd.denyInterfaces = [ cfg.interfaceName ]; + + systemd.network.networks."50-tailscale" = mkIf isNetworkd { + matchConfig = { + Name = cfg.interfaceName; + }; + linkConfig = { + Unmanaged = true; + ActivationPolicy = "manual"; + }; + }; }; }