From 38bba2d23afae649bf1721467f8f2c73ab3702f1 Mon Sep 17 00:00:00 2001 From: Patrick O'Doherty Date: Wed, 14 Feb 2024 11:58:29 -0800 Subject: [PATCH] clientupdate: disable auto update on NixOS (#11136) Updates #cleanup NixOS packages are immutable and attempts to update via our tarball mechanism will always fail as a result. Instead we now direct users to update their nix channel or nixpkgs flake input to receive the latest Tailscale release. Signed-off-by: Patrick O'Doherty --- clientupdate/clientupdate.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clientupdate/clientupdate.go b/clientupdate/clientupdate.go index 1c01fc684..ddd21cd95 100644 --- a/clientupdate/clientupdate.go +++ b/clientupdate/clientupdate.go @@ -167,6 +167,10 @@ func (up *Updater) getUpdateFunction() (fn updateFunction, canAutoUpdate bool) { return up.updateWindows, true case "linux": switch distro.Get() { + case distro.NixOS: + // NixOS packages are immutable and managed with a system-wide + // configuration. + return up.updateNixos, false case distro.Synology: // Synology updates use our own pkgs.tailscale.com instead of the // Synology Package Center. We should eventually get to a regular @@ -522,6 +526,13 @@ func (up *Updater) updateArchLike() error { you can use "pacman --sync --refresh --sysupgrade" or "pacman -Syu" to upgrade the system, including Tailscale.`) } +func (up *Updater) updateNixos() error { + // NixOS package updates are managed on a system level and not individually. + // Direct users to update their nix channel or nixpkgs flake input to + // receive the latest version. + return errors.New(`individual package updates are not supported on NixOS installations. Update your system channel or flake inputs to get the latest Tailscale version from nixpkgs.`) +} + const yumRepoConfigFile = "/etc/yum.repos.d/tailscale.repo" // updateFedoraLike updates tailscale on any distros in the Fedora family,