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

buildGoPackage rec {
  name = "prometheus_varnish_exporter-${version}";
  version = "1.5";

  goPackagePath = "github.com/jonnenauha/prometheus_varnish_exporter";

  src = fetchFromGitHub {
    owner = "jonnenauha";
    repo = "prometheus_varnish_exporter";
    rev = version;
    sha256 = "1040x7fk3s056yrn95siilhi8c9cci2mdncc1xfjf5xj87421qx8";
  };

  goDeps = ./varnish-exporter_deps.nix;

  nativeBuildInputs = [ makeWrapper ];

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

  doCheck = true;

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