nixpkgs/pkgs/servers/monitoring/unpoller/default.nix
2022-12-05 12:21:33 -08:00

38 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, nixosTests
}:
buildGoModule rec {
pname = "unpoller";
version = "2.3.1";
src = fetchFromGitHub {
owner = "unpoller";
repo = "unpoller";
rev = "v${version}";
hash = "sha256-0IknWsJ7fWJuvXeiMZscWEv8p90KZQaQC4Q0KV98Z88=";
};
vendorHash = "sha256-l2V41Rf8KDoh/fC9NcuGF4ISwCLwpbVuzQZiqiGNbuc=";
ldflags = [
"-w" "-s"
"-X github.com/prometheus/common/version.Branch=master"
"-X github.com/prometheus/common/version.BuildDate=unknown"
"-X github.com/prometheus/common/version.Revision=${src.rev}"
"-X github.com/prometheus/common/version.Version=${version}-0"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) unpoller; };
meta = with lib; {
description = "Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus";
homepage = "https://github.com/unpoller/unpoller";
changelog = "https://github.com/unpoller/unpoller/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ Frostman ];
};
}