My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: improve tailscale-ready ordering for nixos-rebuild

- Add bindsTo=tailscaled.service so tailscale-ready stops when
tailscaled restarts (prevents race during switch)
- Increase timeout to 60s
- Better logging for debugging

During nixos-rebuild switch, tailscaled gets restarted. The old
tailscale-ready could start before the new tailscaled was ready.
bindsTo ensures they're stopped/started together.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>

+9 -2
+9 -2
modules/server/infra/network/caddy.nix
··· 41 41 systemd.services.tailscale-ready = lib.mkIf hasTailnet { 42 42 description = "Wait for Tailscale interface to be ready"; 43 43 after = [ "tailscaled.service" ]; 44 - wants = [ "tailscaled.service" ]; 44 + bindsTo = [ "tailscaled.service" ]; 45 45 wantedBy = [ "multi-user.target" ]; 46 46 before = [ "caddy.service" ]; 47 47 serviceConfig = { ··· 50 50 }; 51 51 script = '' 52 52 echo "Waiting for Tailscale interface to be ready..." 53 - for i in $(seq 1 30); do 53 + for i in $(seq 1 60); do 54 + # Check if tailscale0 exists with the expected IP 54 55 if ip addr show tailscale0 2>/dev/null | grep -q "${cfg.server.tailscaleIP}"; then 55 56 echo "Tailscale interface ready with IP ${cfg.server.tailscaleIP}" 56 57 exit 0 58 + fi 59 + # If tailscaled is still starting/restarting, wait for it 60 + if systemctl is-active --quiet tailscaled.service; then 61 + echo "tailscaled is active, waiting for interface..." 62 + else 63 + echo "tailscaled not yet active, waiting..." 57 64 fi 58 65 sleep 1 59 66 done