2023-10-12 10:11:02 -04:00
|
|
|
let
|
|
|
|
pkgs = import <nixpkgs> { };
|
|
|
|
goAttr = pkgs.go_1_21.overrideAttrs (_: rec {
|
2023-12-08 06:11:31 -05:00
|
|
|
version = "1.21.5";
|
2023-10-12 10:11:02 -04:00
|
|
|
src = pkgs.fetchurl {
|
|
|
|
url = "https://go.dev/dl/go${version}.src.tar.gz";
|
2023-12-08 06:11:31 -05:00
|
|
|
hash = "sha256-KFy730tubmLtWPNw8/bYwwgl1uVsWFPGbTwjvNsJ2xk=";
|
2023-10-12 10:11:02 -04:00
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
pkgs.buildEnv
|
|
|
|
{
|
|
|
|
name = "bazel-go-toolchain";
|
|
|
|
paths = [ goAttr ];
|
|
|
|
postBuild = ''
|
|
|
|
touch $out/ROOT
|
|
|
|
ln -s $out/share/go/{api,doc,lib,misc,pkg,src,go.env} $out/
|
|
|
|
'';
|
|
|
|
} // {
|
|
|
|
version = goAttr.version;
|
|
|
|
}
|