gh: modernize

installBin, structuredAttrs, and versionCheckHook

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
Ethan Carter Edwards
2026-05-16 04:10:50 -04:00
parent 0ec9b63333
commit 1c29db7cdb
+6 -5
View File
@@ -4,7 +4,7 @@
buildGoModule,
installShellFiles,
stdenv,
testers,
versionCheckHook,
makeWrapper,
}:
@@ -12,6 +12,8 @@ buildGoModule (finalAttrs: {
pname = "gh";
version = "2.92.0";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "cli";
repo = "cli";
@@ -36,7 +38,7 @@ buildGoModule (finalAttrs: {
installPhase = ''
runHook preInstall
install -Dm755 bin/gh -t $out/bin
installBin bin/gh
wrapProgram $out/bin/gh \
--set-default GH_TELEMETRY false
''
@@ -55,9 +57,8 @@ buildGoModule (finalAttrs: {
# most tests require network access
doCheck = false;
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
};
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
meta = {
description = "GitHub CLI tool";