about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix')
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix b/nixpkgs/pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix
new file mode 100644
index 000000000000..64105c9c58f2
--- /dev/null
+++ b/nixpkgs/pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix
@@ -0,0 +1,26 @@
+{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
+
+buildGoModule rec {
+  pname = "apcupsd-exporter";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "mdlayher";
+    repo = "apcupsd_exporter";
+    rev = "v${version}";
+    sha256 = "0gjj23qdjs7rqimq95rbfw43m4l6g73j840svxjlmpd1vzzz2v2q";
+  };
+
+  vendorSha256 = "09x8y8pmgfn897hvnk122ry460y12b8a7y5fafri5wn9vxab9r82";
+
+  doCheck = false;
+
+  passthru.tests = { inherit (nixosTests.prometheus-exporters) apcupsd; };
+
+  meta = with lib; {
+    description = "Provides a Prometheus exporter for the apcupsd Network Information Server (NIS)";
+    homepage = "https://github.com/mdlayher/apcupsd_exporter";
+    license = licenses.mit;
+    maintainers = with maintainers; [ _1000101 mdlayher ];
+  };
+}