helmfile: unpin buildGoModule
[NixPkgs.git] / pkgs / applications / networking / avalanchego / default.nix
blob87faa8ae0b6486364cd9333ef15da8717da3a850
1 { IOKit
2 , buildGoModule
3 , fetchFromGitHub
4 , lib
5 , stdenv
6 }:
8 buildGoModule rec {
9   pname = "avalanchego";
10   version = "1.11.8";
12   src = fetchFromGitHub {
13     owner = "ava-labs";
14     repo = pname;
15     rev = "v${version}";
16     hash = "sha256-lb0kjPvpjqHQ+DUdrQmaSIaxEdwsOq29RTe3zL25NQc=";
17   };
19   vendorHash = "sha256-CN+2+aOOPF7gouvp7lCfRIKA1quNCcrvzHg8lF6J4f8=";
20   # go mod vendor has a bug, see: https://github.com/golang/go/issues/57529
21   proxyVendor = true;
23   buildInputs = lib.optionals stdenv.isDarwin [ IOKit ];
25   subPackages = [ "main" ];
27   ldflags = [
28     "-s"
29     "-w"
30     "-X github.com/ava-labs/avalanchego/version.GitCommit=${version}"
31   ];
33   postInstall = ''
34     mv $out/bin/{main,${pname}}
35   '';
37   meta = with lib; {
38     description = "Go implementation of an Avalanche node";
39     homepage = "https://github.com/ava-labs/avalanchego";
40     changelog = "https://github.com/ava-labs/avalanchego/releases/tag/v${version}";
41     license = licenses.bsd3;
42     maintainers = with maintainers; [ urandom qjoly ];
43     mainProgram = "avalanchego";
44   };