diff options
| author | Fuwn <[email protected]> | 2024-09-22 15:26:29 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-22 15:26:29 -0700 |
| commit | e9576ef84bf5d442447830a36805932945a25a3b (patch) | |
| tree | ece934f6db92f12225bf42246040a2ced103472c /modules/core/tailscale.nix | |
| parent | core: move kansai security to desktop (diff) | |
| download | nixos-config-e9576ef84bf5d442447830a36805932945a25a3b.tar.xz nixos-config-e9576ef84bf5d442447830a36805932945a25a3b.zip | |
core: move tailscale
Diffstat (limited to 'modules/core/tailscale.nix')
| -rw-r--r-- | modules/core/tailscale.nix | 35 |
1 files changed, 35 insertions, 0 deletions
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}" ]; + + # <https://tailscale.com/kb/1019/subnets/?tab=linux#step-1-install-the-tailscale-client> + 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 + ''; + }; + }; + }; +} |