about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/version-management/git-and-tools/hut/default.nix
blob: ad0c02aa2e0d685463fc7e5ddb066b55ff4894ca (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
39
40
41
42
43
{ lib
, buildGoModule
, fetchFromSourcehut
, scdoc
, unstableGitUpdater
}:

buildGoModule {
  pname = "hut";
  version = "unstable-2022-03-02";

  src = fetchFromSourcehut {
    owner = "~emersion";
    repo = "hut";
    rev = "55ad2fbd9ceeeb9e7dc203c15476fa785f1209e0";
    sha256 = "sha256-j2IVwCm7iq3JKccPL8noRBhqw+V+4qfcpAwV65xhZk0=";
  };

  vendorSha256 = "sha256-zdQvk0M1a+Y90pnhqIpKxLJnlVJqMoSycewTep2Oux4=";

  nativeBuildInputs = [
    scdoc
  ];

  makeFlags = [ "PREFIX=$(out)" ];

  postBuild = ''
    make $makeFlags completions doc/hut.1
  '';

  preInstall = ''
    make $makeFlags install
  '';

  passthru.updateScript = unstableGitUpdater { };

  meta = with lib; {
    homepage = "https://sr.ht/~emersion/hut/";
    description = "A CLI tool for Sourcehut / sr.ht";
    license = licenses.agpl3Only;
    maintainers = with maintainers; [ fgaz ];
  };
}