1 { stdenv, rustPlatform, fetchFromGitHub, lib, libiconv, Security, nixosTests }:
3 rustPlatform.buildRustPackage rec {
4 pname = "wireguard-exporter";
7 src = fetchFromGitHub {
9 repo = "prometheus_wireguard_exporter";
11 sha256 = "sha256-2e31ZuGJvpvu7L2Lb+n6bZWpC1JhETzEzSiNaxxsAtA=";
14 cargoHash = "sha256-NsxGpjuZPpz4gCJRp5IOcfRFh8DTud47nV2bE0/kc2Q=";
17 # drop hardcoded linker names, fixing static build
21 buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
23 passthru.tests = { inherit (nixosTests.prometheus-exporters) wireguard; };
26 description = "Prometheus exporter for WireGuard, written in Rust";
27 homepage = "https://github.com/MindFlavor/prometheus_wireguard_exporter";
28 license = licenses.mit;
29 maintainers = with maintainers; [ ma27 globin ];
30 mainProgram = "prometheus_wireguard_exporter";