Maiko Tan 0619df716e
gh-signoff: init at 0.2.1
Co-authored-by: Aleksana <alexander.huang.y@gmail.com>
2025-06-30 14:57:42 +08:00

62 lines
1.2 KiB
Nix

{
lib,
stdenvNoCC,
fetchFromGitHub,
bash,
gh,
git,
jq,
makeWrapper,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "gh-signoff";
version = "0.2.1"; # version is in the script
src = fetchFromGitHub {
owner = "basecamp";
repo = "gh-signoff";
rev = "24f274070c9dfbb3916347dbf6f9d38d4fb64eca"; # Repo didn't have a valid Git tag for specific version
hash = "sha256-jqRbh4To6uHoohkNZrzgmGWOBp/Mahmjm5NwXjmshhM=";
};
nativeBuildInputs = [
makeWrapper
];
buildInputs = [ bash ];
strictDeps = true;
runtimeDeps = [
gh
git
jq
];
installPhase = ''
runHook preInstall
install -D -m755 "gh-signoff" "$out/bin/gh-signoff"
runHook postInstall
'';
postFixup = ''
wrapProgram "$out/bin/gh-signoff" \
--prefix PATH : "${lib.makeBinPath finalAttrs.runtimeDeps}"
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "GitHub CLI extension for local CI to sign off on your own work";
homepage = "https://github.com/basecamp/gh-signoff";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ maikotan ];
mainProgram = "gh-signoff";
inherit (gh.meta) platforms;
};
})