From e9576ef84bf5d442447830a36805932945a25a3b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 22 Sep 2024 15:26:29 -0700 Subject: core: move tailscale --- modules/core/tailscale.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/core/tailscale.nix (limited to 'modules/core/tailscale.nix') diff --git a/modules/core/tailscale.nix b/modules/core/tailscale.nix new file mode 100644 index 0000000..0228915 --- /dev/null +++ b/modules/core/tailscale.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + networking.firewall.trustedInterfaces = [ "${config.services.tailscale.interfaceName}" ]; + + # + boot.kernel.sysctl = { + "net.ipv4.ip_forward" = true; + "net.ipv6.conf.all.forwarding" = true; + }; + + services = { + tailscale = { + enable = true; + useRoutingFeatures = "both"; + authKeyFile = config.sops.secrets.tailscale_authentication_key.path; + }; + + networkd-dispatcher = { + enable = true; + + rules."50-tailscale" = { + onState = [ "routable" ]; + + script = '' + ${lib.getExe pkgs.ethtool} -K enp42s0 rx-udp-gro-forwarding on rx-gro-list off + ''; + }; + }; + }; +} -- cgit v1.2.3