nix: update to Go 1.26 and fix deprecations

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
This commit is contained in:
Kristoffer Dalby 2026-01-21 16:21:44 +00:00
parent b36438bf90
commit 35364bfc9a
2 changed files with 14 additions and 13 deletions

8
flake.lock generated
View file

@ -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"
}

View file

@ -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 {