cofractal-ams01: switch to tailscale-in-polling mode to reduce logspam and CPU

This commit is contained in:
Luke Granger-Brown 2023-04-15 14:31:39 +00:00
parent f0846a9171
commit 389be0c195
3 changed files with 19 additions and 0 deletions

View file

@ -74,4 +74,6 @@
factorio-mods = import ./factorio-mods args;
libsolv-py = pkgs.callPackage ./libsolv-py.nix { };
tailscale = import ./tailscale pkgs.tailscale;
} // (import ./heptapod-runner args)

View file

@ -0,0 +1,16 @@
tailscale:
tailscale.overrideAttrs (old: {
postPatch = ''
${old.postPatch or ""}
# Always use the polling monitor on routers. The netlink-based monitor is
# effectively just a wakeup-every-250ms system which causes ridiculously
# high CPU.
rm wgengine/monitor/monitor_linux.go
substituteInPlace wgengine/monitor/monitor_polling.go \
--replace \
"//go:build (!linux && !freebsd && !windows && !darwin) || android" \
""
'';
})

View file

@ -168,6 +168,7 @@ in
}
];
services.tailscale.package = depot.nix.pkgs.tailscale;
systemd.network.config.networkConfig.ManageForeignRoutes = "no";
systemd.mounts = let
bindMount' = dir: {