Unverified Commit baba1388 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

nixos/tailscale: run `tailscale up` when in Stopped status, run tailscaled-set...

nixos/tailscale: run `tailscale up` when in Stopped status, run tailscaled-set after tailscaled-autoconnect (#409924)
parents d3c9c64a ffca56ed
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ in
            if [[ "$state" != "$lastState" ]]; then
              # https://github.com/tailscale/tailscale/blob/v1.72.1/ipn/backend.go#L24-L32
              case "$state" in
                NeedsLogin)
                NeedsLogin|NeedsMachineAuth|Stopped)
                  echo "Server needs authentication, sending auth key"
                  tailscale up --auth-key "$(cat ${cfg.authKeyFile})${params}" ${escapeShellArgs cfg.extraUpFlags}
                  ;;
@@ -235,7 +235,10 @@ in
    };

    systemd.services.tailscaled-set = mkIf (cfg.extraSetFlags != [ ]) {
      after = [ "tailscaled.service" ];
      after = [
        "tailscaled.service"
        "tailscaled-autoconnect.service"
      ];
      wants = [ "tailscaled.service" ];
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {