2024-09-26 11:04:55 +00:00
|
|
|
{ stdenvNoCC
|
2023-01-11 07:51:40 +00:00
|
|
|
, lib
|
|
|
|
, bash
|
|
|
|
, coreutils
|
|
|
|
, findutils
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fzf
|
2024-09-26 11:04:55 +00:00
|
|
|
, gawk
|
2023-01-11 07:51:40 +00:00
|
|
|
, git
|
|
|
|
, gnugrep
|
|
|
|
, gnused
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2022-12-02 08:20:57 +00:00
|
|
|
pname = "zsh-forgit";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "24.10.0";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wfxr";
|
|
|
|
repo = "forgit";
|
2024-09-26 11:04:55 +00:00
|
|
|
rev = "refs/tags/${finalAttrs.version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-g1uedR9BLG0DuGdM/9xqFv6yhBHHnqjQMt1n0z9I29I=";
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace forgit.plugin.zsh \
|
2024-09-26 11:04:55 +00:00
|
|
|
--replace-fail "\$FORGIT_INSTALL_DIR/bin/git-forgit" "$out/bin/git-forgit"
|
2022-12-02 08:20:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
installPhase = ''
|
2022-12-17 10:02:37 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -D bin/git-forgit $out/bin/git-forgit
|
2023-08-04 22:07:22 +00:00
|
|
|
install -D completions/_git-forgit $out/share/zsh/site-functions/_git-forgit
|
2024-09-26 11:04:55 +00:00
|
|
|
install -D forgit.plugin.zsh $out/share/zsh/${finalAttrs.pname}/forgit.plugin.zsh
|
2022-12-17 10:02:37 +00:00
|
|
|
wrapProgram $out/bin/git-forgit \
|
2024-09-26 11:04:55 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ bash coreutils findutils fzf gawk git gnugrep gnused ]}
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2022-12-02 08:20:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/wfxr/forgit";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Utility tool powered by fzf for using git interactively";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "git-forgit";
|
2022-12-02 08:20:57 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ deejayem ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2024-09-26 11:04:55 +00:00
|
|
|
})
|