From 35364bfc9a7e4ffdadb8271fc3f3d8ec527e603c Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 21 Jan 2026 16:21:44 +0000 Subject: [PATCH] nix: update to Go 1.26 and fix deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update nixpkgs to master branch to get Go 1.26rc2. This is needed for the new Go 1.26 features used in the codebase. Changes: - Use buildGo126Module and go_1_26 in build dependencies - Update vendorHash for new dependencies - Fix deprecated flake outputs: overlay→overlays.default, devShell→devShells.default, defaultPackage→packages.default - Fix stdenv.isLinux→stdenv.hostPlatform.isLinux deprecation --- flake.lock | 8 ++++---- flake.nix | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 50a7dde2..29f6b326 100644 --- a/flake.lock +++ b/flake.lock @@ -20,16 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766840161, - "narHash": "sha256-Ss/LHpJJsng8vz1Pe33RSGIWUOcqM1fjrehjUkdrWio=", + "lastModified": 1769011238, + "narHash": "sha256-WPiOcgZv7GQ/AVd9giOrlZjzXHwBNM4yQ+JzLrgI3Xk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3edc4a30ed3903fdf6f90c837f961fa6b49582d1", + "rev": "a895ec2c048eba3bceab06d5dfee5026a6b1c875", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "master", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 48aa075c..8aa8d32b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,8 @@ description = "headscale - Open Source Tailscale Control server"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + # TODO: Move back to nixpkgs-unstable once Go 1.26 is available there + nixpkgs.url = "github:NixOS/nixpkgs/master"; flake-utils.url = "github:numtide/flake-utils"; }; @@ -23,11 +24,11 @@ default = headscale; }; - overlay = _: prev: + overlays.default = _: prev: let pkgs = nixpkgs.legacyPackages.${prev.system}; - buildGo = pkgs.buildGo125Module; - vendorHash = "sha256-escboufgbk+lEitw48eWEIltXbaCPdysb/g4YR+extg="; + buildGo = pkgs.buildGo126Module; + vendorHash = "sha256-hL9vHunaxodGt3g/CIVirXy4OjZKTI3XwbVPPRb34OY="; in { headscale = buildGo { @@ -129,10 +130,10 @@ (system: let pkgs = import nixpkgs { - overlays = [ self.overlay ]; + overlays = [ self.overlays.default ]; inherit system; }; - buildDeps = with pkgs; [ git go_1_25 gnumake ]; + buildDeps = with pkgs; [ git go_1_26 gnumake ]; devDeps = with pkgs; buildDeps ++ [ @@ -167,7 +168,7 @@ clang-tools # clang-format protobuf-language-server ] - ++ lib.optional pkgs.stdenv.isLinux [ traceroute ]; + ++ lib.optional pkgs.stdenv.hostPlatform.isLinux [ traceroute ]; # Add entry to build a docker image with headscale # caveat: only works on Linux @@ -184,7 +185,7 @@ in rec { # `nix develop` - devShell = pkgs.mkShell { + devShells.default = pkgs.mkShell { buildInputs = devDeps ++ [ @@ -219,8 +220,8 @@ packages = with pkgs; { inherit headscale; inherit headscale-docker; + default = headscale; }; - defaultPackage = pkgs.headscale; # `nix run` apps.headscale = flake-utils.lib.mkApp {