From 7ad43db433beb7ea280e311a11dd04d39aae596b Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Sun, 15 Nov 2026 15:49:20 +0100 Subject: [PATCH] pinwheel: Name the exit node in the tailscale connect notification The notification shows the exit node's hostname, followed by its city and country when tailscale knows the node's location. --- hosts/pinwheel/modules/waybar/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/pinwheel/modules/waybar/default.nix b/hosts/pinwheel/modules/waybar/default.nix index 21109b0..d8550d1 100644 --- a/hosts/pinwheel/modules/waybar/default.nix +++ b/hosts/pinwheel/modules/waybar/default.nix @@ -75,7 +75,12 @@ let if [ "$EXIT_NODE_ONLINE" == "true" ]; then tailscale set --exit-node="" && ${pkgs.libnotify}/bin/notify-send "Disconnected from Exit Node" else - tailscale set --exit-node=$PREFERRED_EXIT_NODE && ${pkgs.libnotify}/bin/notify-send "Connected to Exit Node" + tailscale set --exit-node=$PREFERRED_EXIT_NODE || exit 1 + + EXIT_NODE_NAME=$(tailscale status --json | ${pkgs.jq}/bin/jq -r ' + .Peer.[] | select(.ExitNode) + | .HostName + (if .Location then " (\(.Location.City), \(.Location.Country))" else "" end)') + ${pkgs.libnotify}/bin/notify-send "Connected to Exit Node" "$EXIT_NODE_NAME" fi }