From d4ca2c252454695768f15cba20d69cad94e7d504 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Mon, 24 Aug 2026 01:50:56 -0700 Subject: [PATCH] Use cached Go 1.27 from nixpkgs Refresh nixpkgs-unstable now that it carries stable Go 1.27.0, then remove the temporary source-toolchain override so cold Nix stores substitute Go from cache.nixos.org. --- flake.lock | 6 +++--- nix/go.nix | 30 +++++------------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index fe0dde09..30d0a9a3 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1787414105, - "narHash": "sha256-WncT27+3BOkgTaJZLnCsf3LcYf9RXMuR9ONSN4rzQ7s=", + "lastModified": 1787394516, + "narHash": "sha256-pRGOQSClnXNI2iLUG6DYpsGvYcuw0drOutVZFTJNw90=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9e6d84f9c2f9012f5fe7d964a7851352300e61a", + "rev": "c8f90650c15282fa8656a041bfbbd2403997a9a7", "type": "github" }, "original": { diff --git a/nix/go.nix b/nix/go.nix index b92a75e1..04fe8168 100644 --- a/nix/go.nix +++ b/nix/go.nix @@ -1,28 +1,8 @@ -{ lib, fetchurl, go_1_27 }: +{ go_1_27 }: # The Go toolchain shared by the package build and the dev shell. # -# go.mod's `go` directive is the floor; nixpkgs-unstable lagged it at 1.27rc3 -# when go.mod moved to 1.27.0, so the toolchain is rebuilt from the upstream -# source tarball until nixpkgs catches up. The override is conditional and -# drops itself once go_1_27 reaches 1.27.0 — delete this file's override and -# return go_1_27 directly after a `nix flake update` that makes -# `lib.versionOlder` false. Keep minGo in step with go.mod: a toolchain bump -# that outpaces flake.lock breaks the build without touching go.mod or go.sum, -# which is why the nix-build CI job runs on every go.mod change and on tags. -# -# Both consumers must use this one derivation. The dev shell once listed -# the nixpkgs Go directly, which handed `nix develop` a Go older than go.mod's -# directive — `make build` then failed under GOTOOLCHAIN=local or offline. -let - minGo = "1.27.0"; -in -if lib.versionOlder go_1_27.version minGo -then go_1_27.overrideAttrs (_: { - version = minGo; - src = fetchurl { - url = "https://go.dev/dl/go${minGo}.src.tar.gz"; - hash = "sha256-cAJAPXzERSnvbSb2mkSBgmM5Xq18FsBaWAiuBH6+sOU="; - }; -}) -else go_1_27 +# Both consumers use this one derivation so the package and `nix develop` +# cannot drift. Keep flake.lock new enough that go_1_27 satisfies go.mod; +# the nix-build CI job covers every go.mod change and every release tag. +go_1_27