lol
1{ stdenv
2, lib
3, bash
4, coreutils
5, findutils
6, fetchFromGitHub
7, fzf
8, git
9, gnugrep
10, gnused
11, makeWrapper
12}:
13
14stdenv.mkDerivation rec {
15 pname = "zsh-forgit";
16 version = "23.09.0";
17
18 src = fetchFromGitHub {
19 owner = "wfxr";
20 repo = "forgit";
21 rev = version;
22 sha256 = "sha256-WvJxjEzF3vi+YPVSH3QdDyp3oxNypMoB71TAJ7D8hOQ=";
23 };
24
25 strictDeps = true;
26
27 postPatch = ''
28 substituteInPlace forgit.plugin.zsh \
29 --replace "\$INSTALL_DIR/bin/git-forgit" "$out/bin/git-forgit"
30 '';
31
32 dontBuild = true;
33
34 nativeBuildInputs = [ makeWrapper ];
35
36 installPhase = ''
37 runHook preInstall
38
39 install -D bin/git-forgit $out/bin/git-forgit
40 install -D completions/_git-forgit $out/share/zsh/site-functions/_git-forgit
41 install -D completions/git-forgit.zsh $out/share/zsh/${pname}/git-forgit.zsh
42 install -D forgit.plugin.zsh $out/share/zsh/${pname}/forgit.plugin.zsh
43 wrapProgram $out/bin/git-forgit \
44 --prefix PATH : ${lib.makeBinPath [ bash coreutils findutils fzf git gnugrep gnused ]}
45
46 runHook postInstall
47 '';
48
49 meta = with lib; {
50 homepage = "https://github.com/wfxr/forgit";
51 description = "A utility tool powered by fzf for using git interactively";
52 license = licenses.mit;
53 maintainers = with maintainers; [ deejayem ];
54 platforms = platforms.all;
55 };
56}