Files
nixos-configs/hosts/backwards/modules/tailscale/default.nix
T
Alexander Heldt f31ac25f3d backwards: Replace tailscale-qs with the official tailscale systray
The `tailscale-qs` extension's node list could not be opened. The
official `tailscale systray` shows the nodes and exit nodes, with the
AppIndicator extension providing a tray in GNOME. The systray never
retries if no tray exists when it starts, so it waits for one first.
2026-11-13 19:42:38 +01:00

50 lines
1.3 KiB
Nix

{
config,
lib,
pkgs,
...
}:
{
services.tailscale = {
enable = true;
# Required for the systray to control tailscale without root
extraSetFlags = [ "--operator=alex" ];
};
networking.firewall = {
checkReversePath = "loose";
allowedUDPPorts = [ 41641 ];
};
home-manager.users.alex = {
# The official tailscale systray, including the node list and exit nodes
services.tailscale-systray = {
enable = true;
package = config.services.tailscale.package;
};
# The systray never retries if no tray exists when it starts, so wait for the
# AppIndicator extension to provide one. This is done in the main process,
# rather than `ExecStartPre`, to not block activation while waiting
systemd.user.services.tailscale-systray.Service.ExecStart = lib.mkForce (toString (
pkgs.writeShellScript "tailscale-systray" ''
until ${pkgs.systemd}/bin/busctl --user status org.kde.StatusNotifierWatcher >/dev/null 2>&1; do
sleep 1
done
exec ${lib.getExe config.services.tailscale.package} systray
''
));
programs.gnome-shell = {
enable = true;
extensions = [
# GNOME has no system tray without it
{ package = pkgs.gnomeExtensions.appindicator; }
];
};
};
}