Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit d42a99b

Browse files
authored
nix: use go1.22.4 (#63372)
Tired of seeing the go toolchain being easier to use than nix. Test Plan: nix develop on linux amd64 and macbook arm64 followed by running "go test ./internal/search" working. Also confirming that "go env GOROOT" points into the nix store.
1 parent 3b79195 commit d42a99b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

dev/nix/go_1_22.nix

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{ pkgs, fetchurl }:
2+
pkgs.go_1_22.overrideAttrs rec {
3+
# PLEASE UPDATE THE SHA512 BELOW OR NOTIFY ONE OF THE NIX USERS BEFORE MERGING A CHANGE TO THESE FILES
4+
version = "1.22.4";
5+
src = fetchurl {
6+
url = "https://go.dev/dl/go${version}.src.tar.gz";
7+
hash = "sha256-/tcgZ45yinyjC6jR3tHKr+J9FgKPqwIyuLqOIgCPt4Q=";
8+
};
9+
}

flake.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
(system:
2727
let
2828
pkgs = nixpkgs.legacyPackages.${system};
29-
pkgsShell = import nixpkgs { inherit system; overlays = with self.overlays; [ nodejs-20_x bazel_7 ]; };
29+
pkgsShell = import nixpkgs { inherit system; overlays = with self.overlays; [ nodejs-20_x bazel_7 go_1_22 ]; };
3030
pkgsBins = nixpkgs-stable.legacyPackages.${system};
3131
pkgsAll = import nixpkgs { inherit system; overlays = builtins.attrValues self.overlays; };
3232
pkgsX = xcompileTargets.${system} or null;
@@ -47,6 +47,7 @@
4747
# tzdata fails to build on pkgsStatic, and pkgsMusl isnt supported on macos
4848
tzdata = if pkgs.hostPlatform.isMacOS then pkgs.tzdata else pkgs.pkgsMusl.tzdata;
4949
};
50+
go_1_22 = pkgs.callPackage ./dev/nix/go_1_22.nix { };
5051
};
5152

5253
# We use pkgsShell (not pkgsAll) intentionally to avoid doing extra work of
@@ -63,6 +64,7 @@
6364
p4-fusion = final: prev: { p4-fusion = self.packages.${prev.system}.p4-fusion; };
6465
bazel_7 = final: prev: { bazel_7 = self.packages.${prev.system}.bazel_7; };
6566
pg-utils = final: prev: { pg-utils = self.packages.${prev.system}.pg-utils; };
67+
go_1_22 = final: prev: { go_1_22 = self.packages.${prev.system}.go_1_22; };
6668
};
6769
};
6870
}

0 commit comments

Comments
 (0)