summaryrefslogtreecommitdiff
path: root/pkgs/forgit.nix
blob: 07cad43766c8ed33d74583c3d3c15eb71d41341a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, stdenv, fetchFromGitHub, bash, fzf, git }:

stdenv.mkDerivation rec {
  pname = "forgit";
  version = "unstable-2022-4-20";

  src = fetchFromGitHub {
    owner = "wfxr";
    repo = "forgit";
    rev = "fa9fd624398643d53ea9cea61d66eca77ca7c46c";
    sha256 = "sha256:1hq1qbpfj0kfld8rvqf7mhh83mll6baq26p1cp0sr68cf66nl51q";
  };

  buildInputs = [ bash fzf ];
  dontBuild = true;

  installPhase = ''
    runHook preInstall

    substituteInPlace forgit.plugin.zsh \
         --replace \$FORGIT_INSTALL_DIR $out/share/bash

    install -Dt "$out/bin/" -m744 bin/git-forgit
    install -Dt "$out/share/bash/" -m444 forgit.plugin.zsh

    runHook postInstall
  '';

  meta = with lib; {
    description = "A utility tool powered by fzf for using git interactively";
    homepage = "https://github.com/wfxr/forgit";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ bsima ];
  };
}