summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ho/hound/package.nix
blob: 49ea4d399d6b174b0c212acfd9559ab766084b69 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  makeWrapper,
  mercurial,
  git,
  openssh,
  nixosTests,
}:

buildGoModule (finalAttrs: {
  pname = "hound";
  version = "0.7.1";

  src = fetchFromGitHub {
    owner = "hound-search";
    repo = "hound";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-Qdk57zLjTXLdDEmB6K+sZAym5s0BekJJa/CpYeOBOcY=";
  };

  patches = [
    # add check config flag
    # https://github.com/hound-search/hound/pull/485
    ./check-config-flag.diff
  ];

  vendorHash = "sha256-0psvz4bnhGuwwSAXvQp0ju0GebxoUyY2Rjp/D43KF78=";

  nativeBuildInputs = [ makeWrapper ];

  # requires network access
  doCheck = false;

  postInstall = ''
    wrapProgram $out/bin/houndd --prefix PATH : ${
      lib.makeBinPath [
        mercurial
        git
        openssh
      ]
    }
  '';

  passthru.tests = { inherit (nixosTests) hound; };

  meta = {
    description = "Lightning fast code searching made easy";
    homepage = "https://github.com/hound-search/hound";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      SuperSandro2000
    ];
  };
})