about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/monitoring/prometheus/systemd-exporter.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/monitoring/prometheus/systemd-exporter.nix')
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/systemd-exporter.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/systemd-exporter.nix b/nixpkgs/pkgs/servers/monitoring/prometheus/systemd-exporter.nix
new file mode 100644
index 000000000000..5448aeb52d59
--- /dev/null
+++ b/nixpkgs/pkgs/servers/monitoring/prometheus/systemd-exporter.nix
@@ -0,0 +1,35 @@
+{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
+
+buildGoModule rec {
+  pname = "systemd_exporter";
+  version = "0.6.0";
+
+  vendorHash = "sha256-D5ASUP6XHNeHZqH/ui5GvxWis/NQrRpN/+wkO4fKkA8=";
+
+  src = fetchFromGitHub {
+    owner = "prometheus-community";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-zLg4cOZUh50OFPp4mKR/FY0JfzVmXmDFcKkhB6DalGc=";
+  };
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X github.com/prometheus/common/version.Version=${version}"
+    "-X github.com/prometheus/common/version.Revision=unknown"
+    "-X github.com/prometheus/common/version.Branch=unknown"
+    "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
+    "-X github.com/prometheus/common/version.BuildDate=unknown"
+  ];
+
+  passthru.tests = { inherit (nixosTests.prometheus-exporters) systemd; };
+
+  meta = with lib; {
+    description = "Exporter for systemd unit metrics";
+    mainProgram = "systemd_exporter";
+    homepage = "https://github.com/prometheus-community/systemd_exporter";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ chkno ];
+  };
+}