summary refs log tree commit diff
path: root/pkgs/servers/monitoring/prometheus/varnish-exporter.nix
blob: a0e3c6b1783c8ec18a7db2b3f7e2fb820593758f (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
{ stdenv, buildGoModule, fetchFromGitHub, makeWrapper, varnish, Security }:

buildGoModule rec {
  pname = "prometheus_varnish_exporter";
  version = "1.5.2";

  src = fetchFromGitHub {
    owner = "jonnenauha";
    repo = "prometheus_varnish_exporter";
    rev = version;
    sha256 = "0rpabw6a6paavv62f0gzhax9brzcgkly27rhkf0ihw8736gkw8ar";
  };

  modSha256 = "0w1zg9jc2466srx9pdckw7rzn7ma4pbd0617b1h98v364wjzgj72";

  nativeBuildInputs = [ makeWrapper ];

  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security ];

  postInstall = ''
    wrapProgram $out/bin/prometheus_varnish_exporter \
      --prefix PATH : "${varnish}/bin"
  '';

  doCheck = true;

  meta = with stdenv.lib; {
    homepage = "https://github.com/jonnenauha/prometheus_varnish_exporter";
    description = "Varnish exporter for Prometheus";
    license = licenses.mit;
    maintainers = with maintainers; [ MostAwesomeDude willibutz ];
  };
}