1{
2 buildGoModule,
3 lib,
4 fetchFromGitHub,
5}:
6
7buildGoModule rec {
8 pname = "zfs_exporter";
9 version = "2.3.8";
10
11 src = fetchFromGitHub {
12 owner = "pdf";
13 repo = pname;
14 rev = "v" + version;
15 hash = "sha256-bFS4JdmtHdRPNSZP2YZQEl8y9AC6aKpxgN1D0W4dIwc=";
16 };
17
18 vendorHash = "sha256-P0KqKHQsocM/mrOUDJb4iNaFxJILF4toHPf7DIwMzBw=";
19
20 ldflags = [
21 "-s"
22 "-w"
23 "-X github.com/prometheus/common/version.Version=${version}"
24 "-X github.com/prometheus/common/version.Revision=unknown"
25 "-X github.com/prometheus/common/version.Branch=unknown"
26 "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
27 "-X github.com/prometheus/common/version.BuildDate=unknown"
28 ];
29
30 postInstall = ''
31 install -Dm444 -t $out/share/doc/${pname} *.md
32 '';
33
34 meta = with lib; {
35 description = "ZFS Exporter for the Prometheus monitoring system";
36 mainProgram = "zfs_exporter";
37 homepage = "https://github.com/pdf/zfs_exporter";
38 license = licenses.mit;
39 maintainers = with maintainers; [ peterhoeg ];
40 };
41}