diff options
author | Vincent Ambo <mail@tazj.in> | 2020-06-16T21·03+0100 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2020-06-16T22·11+0000 |
commit | 65f29ee803888fbad39ae702a565332143a7f4ef (patch) | |
tree | eee9553d2a22c2462c02b7139282ed0a0fb511ee /third_party | |
parent | 9a7a0aa5970a07c8044d761d7beaaf8770771d47 (diff) |
feat(3p/typedGo): Add derivation for the Go alpha with a type system r/1003
The Go language authors have released an experimental version of Go that has a type system: https://blog.golang.org/generics-next-step This overrides the existing Go derivation to build the typed Go. The next step is a buildTypedGo set of functions that wrap buildGo. Change-Id: Idb8a4868bca003d821ed5cb324af633398faf002 Reviewed-on: https://cl.tvl.fyi/c/depot/+/443 Reviewed-by: lukegb <lukegb@tvl.fyi>
Diffstat (limited to '')
-rw-r--r-- | third_party/default.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/third_party/default.nix b/third_party/default.nix index 8fda06857ef5..0f25b3730e3f 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -179,6 +179,36 @@ in exposed.lib.fix(self: exposed // { clangStdenv = nixpkgs.llvmPackages_10.stdenv; stdenv = nixpkgs.llvmPackages_10.stdenv; + # The Go authors have released a version of Go (in alpha) that has a + # type system. This makes it available, specifically for use with + # //nix/buildTypedGo. + typedGo = nixpkgs.go.overrideAttrs(old: { + version = "dev-go2go"; + doCheck = false; + patches = []; # they all don't apply and are mostly about Darwin crap + + src = nixpkgs.fetchgit { + url = "https://go.googlesource.com/go"; + # You might think these hashes are trivial to update. It's just + # a branch in a git repository, right? + # + # Well, think again. Somehow I managed to get no fewer than 3 + # (!) different commit hashes for the same branch by cloning + # this repository thrice. Only the third one (which you, the + # reader, can find below for your reading pleasure) actually + # gave me `go tool go2go`. + rev = "ad307489d41133f32c779cfa1b0db4a852ace047"; + leaveDotGit = true; + sha256 = "0wxa1zawvmf0hflrb42qi1ggrj28nwr8vjmmygnxny8f00xi8198"; + + postFetch = '' + cd $out + ${nixpkgs.git}/bin/git log -n 1 "--format=format: +%h %cd" HEAD > VERSION + rm -rf .git + ''; + }; + }); + # Make NixOS available nixos = import "${nixpkgsSrc}/nixos"; }) |