Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.05.0";
17
18 src = fetchFromGitHub {
19 owner = "wfxr";
20 repo = "forgit";
21 rev = version;
22 sha256 = "sha256-oBPN8ehz00cDIs6mmGfCBzuDQMLG5z3G6KetJ1FK7e8=";
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 forgit.plugin.zsh $out/share/zsh/${pname}/forgit.plugin.zsh
41 wrapProgram $out/bin/git-forgit \
42 --prefix PATH : ${lib.makeBinPath [ bash coreutils findutils fzf git gnugrep gnused ]}
43
44 runHook postInstall
45 '';
46
47 meta = with lib; {
48 homepage = "https://github.com/wfxr/forgit";
49 description = "A utility tool powered by fzf for using git interactively";
50 license = licenses.mit;
51 maintainers = with maintainers; [ deejayem ];
52 platforms = platforms.all;
53 };
54}