15 src = fetchFromGitHub {
18 rev = "refs/tags/v${version}";
19 hash = "sha256-QOc99KmcGk9b9uy1/y1FSe0zYE1q0g06k7niqtsMDmY=";
22 vendorHash = "sha256-Mje0IbvRj6pmOe8s8PX87ntPE+ZZeciLyOP6fmv7PmI=";
24 nativeBuildInputs = [ installShellFiles ];
28 make GO_LDFLAGS="-s -w" GH_VERSION=${version} bin/gh ${lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) "manpages"}
35 install -Dm755 bin/gh -t $out/bin
37 + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
38 installManPage share/man/*/*.[1-9]
40 installShellCompletion --cmd gh \
41 --bash <($out/bin/gh completion -s bash) \
42 --fish <($out/bin/gh completion -s fish) \
43 --zsh <($out/bin/gh completion -s zsh)
49 # most tests require network access
52 passthru.tests.version = testers.testVersion {
57 description = "GitHub CLI tool";
58 homepage = "https://cli.github.com/";
59 changelog = "https://github.com/cli/cli/releases/tag/v${version}";
60 license = licenses.mit;
62 maintainers = with maintainers; [ zowoq ];