mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-31 20:54:56 +00:00
gh-stack includes a skill that teaches coding agents how to use the CLI, but the package currently installs only the executable. Users must fetch the skill separately, which can leave it out of sync with the packaged CLI version. Install the upstream SKILL.md at `share/skills/gh-stack/gh-stack`, following the emerging consensus in #547426. This makes the skill available from the package and keeps it on the same release as the CLI. Assisted-by: OpenAI Codex (GPT-5)
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
buildGoModule,
|
|
versionCheckHook,
|
|
nix-update-script,
|
|
gitMinimal,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "gh-stack";
|
|
version = "0.1.0";
|
|
|
|
__structuredAttrs = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "github";
|
|
repo = "gh-stack";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-48JkOeqbvHlCZ2u3LnwJymw55xMQWLTPJLDbV44clGI=";
|
|
};
|
|
|
|
vendorHash = "sha256-0Xtr/MOpX4u5GnbRdNxKPA0GpSzi8PIbVc9MmP05De4=";
|
|
|
|
nativeCheckInputs = [ gitMinimal ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X=github.com/github/gh-stack/cmd.Version=${finalAttrs.version}"
|
|
];
|
|
|
|
postInstall = ''
|
|
install -Dm444 skills/gh-stack/SKILL.md $out/share/skills/gh-stack/gh-stack/SKILL.md
|
|
'';
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
doInstallCheck = true;
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "GitHub CLI extension to use stacked PRs";
|
|
homepage = "https://github.github.com/gh-stack/";
|
|
downloadPage = "https://github.com/github/gh-stack/";
|
|
changelog = "https://github.com/github/gh-stack/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
antoineco
|
|
ethancedwards8
|
|
];
|
|
mainProgram = "gh-stack";
|
|
};
|
|
})
|