nixpkgs/pkgs/shells/zsh/zsh-forgit/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.3 KiB
Nix
Raw Normal View History

2023-01-06 13:19:34 +00:00
{ stdenv
, lib
, bash
, coreutils
, findutils
, fetchFromGitHub
, fzf
, git
, gnugrep
, gnused
, makeWrapper
}:
2022-11-24 21:33:57 +00:00
stdenv.mkDerivation rec {
pname = "zsh-forgit";
2024-01-01 15:33:39 +00:00
version = "24.01.0";
2022-11-24 21:33:57 +00:00
src = fetchFromGitHub {
owner = "wfxr";
repo = "forgit";
rev = version;
2024-01-01 15:33:39 +00:00
sha256 = "sha256-WHhyllOr/PgR+vlrfMQs/3/d3xpmDylT6BlLCu50a2g=";
2022-11-24 21:33:57 +00:00
};
strictDeps = true;
postPatch = ''
substituteInPlace forgit.plugin.zsh \
2022-12-08 13:32:03 +00:00
--replace "\$INSTALL_DIR/bin/git-forgit" "$out/bin/git-forgit"
2022-11-24 21:33:57 +00:00
'';
dontBuild = true;
2022-12-08 13:32:03 +00:00
nativeBuildInputs = [ makeWrapper ];
2022-11-24 21:33:57 +00:00
installPhase = ''
2022-12-08 13:32:03 +00:00
runHook preInstall
install -D bin/git-forgit $out/bin/git-forgit
2023-07-06 09:55:53 +00:00
install -D completions/_git-forgit $out/share/zsh/site-functions/_git-forgit
install -D completions/git-forgit.zsh $out/share/zsh/${pname}/git-forgit.zsh
2022-11-24 21:33:57 +00:00
install -D forgit.plugin.zsh $out/share/zsh/${pname}/forgit.plugin.zsh
2022-12-08 13:32:03 +00:00
wrapProgram $out/bin/git-forgit \
2023-01-06 13:19:34 +00:00
--prefix PATH : ${lib.makeBinPath [ bash coreutils findutils fzf git gnugrep gnused ]}
2022-12-08 13:32:03 +00:00
runHook postInstall
2022-11-24 21:33:57 +00:00
'';
meta = with lib; {
homepage = "https://github.com/wfxr/forgit";
description = "A utility tool powered by fzf for using git interactively";
license = licenses.mit;
maintainers = with maintainers; [ deejayem ];
platforms = platforms.all;
};
}