diff --git a/pkgs/by-name/gh/gh-f/package.nix b/pkgs/by-name/gh/gh-f/package.nix index c1b6c4329f6e..22ca4fa5a6de 100644 --- a/pkgs/by-name/gh/gh-f/package.nix +++ b/pkgs/by-name/gh/gh-f/package.nix @@ -2,7 +2,7 @@ lib, fetchFromGitHub, stdenvNoCC, - makeWrapper, + makeBinaryWrapper, gh, fzf, coreutils, @@ -10,48 +10,55 @@ gnused, withBat ? false, bat, + nix-update-script, }: -let - binPath = lib.makeBinPath ( - [ - gh - fzf - coreutils - gawk - gnused - ] - ++ lib.optional withBat bat - ); -in -stdenvNoCC.mkDerivation rec { + +stdenvNoCC.mkDerivation (finalAttrs: { pname = "gh-f"; version = "1.4.1"; src = fetchFromGitHub { owner = "gennaro-tedesco"; repo = "gh-f"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-Jf7sDn/iRB/Lwz21fGLRduvt9/9cs5FFMhazULgj1ik="; }; - nativeBuildInputs = [ - makeWrapper - ]; + nativeBuildInputs = [ makeBinaryWrapper ]; + + propagatedUserEnvPkgs = [ + gh + fzf + coreutils + gawk + gnused + ] + ++ lib.optional withBat bat; installPhase = '' + runHook preInstall + install -D -m755 "gh-f" "$out/bin/gh-f" + + runHook postInstall ''; postFixup = '' - wrapProgram "$out/bin/gh-f" --prefix PATH : "${binPath}" + wrapProgram "$out/bin/gh-f" \ + --suffix PATH : ${lib.makeBinPath finalAttrs.propagatedUserEnvPkgs} ''; - meta = with lib; { + passthru.updateScript = nix-update-script { }; + + meta = { homepage = "https://github.com/gennaro-tedesco/gh-f"; description = "GitHub CLI ultimate FZF extension"; - maintainers = with maintainers; [ loicreynier ]; - license = licenses.unlicense; + license = lib.licenses.unlicense; mainProgram = "gh-f"; - platforms = platforms.all; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ + loicreynier + yiyu + ]; }; -} +})