summary refs log tree commit diff
path: root/pkgs/development/tools/fac/default.nix
blob: c587505600c98ec5fb35578460e0b695f420674e (plain) (blame)
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
37
38
{ stdenv, buildGoPackage, fetchFromGitHub, fetchurl, makeWrapper, git }:

let
  # TODO: Remove this on next update, should be included
  fac_1 = fetchurl {
    url = https://raw.githubusercontent.com/mkchoi212/fac/0a500c2a2dba9017fe7c2a45f15c328755f561a6/doc/fac.1;
    sha256 = "1fsyx9i20ryhpihdpvs2z7vccl13b9bnh5hcdxn7bvqjz78mbqhw";
  };
in buildGoPackage rec {
  name = "fac-${version}";
  version = "1.0.4";

  goPackagePath = "github.com/mkchoi212/fac";

  src = fetchFromGitHub {
    owner = "mkchoi212";
    repo = "fac";
    rev = "v${version}";
    sha256 = "0jhx80jbkxfxj95hmdpb9wwwya064xpfkaa218l1lwm3qwfbpk95";
  };

  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $bin/bin/fac \
      --prefix PATH : ${git}/bin

    install -D ${fac_1} $out/share/man/man1/fac.1
  '';

  meta = with stdenv.lib; {
    description = "CUI for fixing git conflicts";
    inherit (src.meta) homepage;
    license = licenses.mit;
    maintainers = with maintainers; [ dtzWill ];
  };
}