@@ -0,0 +1,36 @@
1+{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
2+
3+buildGoModule rec {
4+ pname = "gh";
5+ version = "0.5.3";
6+
7+ src = fetchFromGitHub {
8+ owner = "cli";
9+ repo = "cli";
10+ rev = "v${version}";
11+ sha256 = "033y9bwdaj8735nmj22k8lrgkgimji7hyly9i4jyp11iaa7cgd7a";
12+ };
13+
14+ modSha256 = "0ina3m2ixkkz2fws6ifwy34pmp6kn5s3j7w40alz6vmybn2smy1h";
15+
16+ buildFlagsArray = [
17+ "-ldflags=-X github.com/cli/cli/command.Version=${version}"
18+ ];
19+
20+ subPackages = [ "cmd/gh" ];
21+
22+ nativeBuildInputs = [ installShellFiles ];
23+ postInstall = ''
24+ for shell in bash fish zsh; do
25+ $out/bin/gh completion -s $shell > gh.$shell
26+ installShellCompletion gh.$shell
27+ done
28+ '';
29+
30+ meta = with lib; {
31+ description = "GitHub CLI tool";
32+ homepage = "https://github.com/cli/cli";
33+ license = licenses.mit;
34+ maintainers = with maintainers; [ zowoq ];
35+ };
36+}