summary refs log tree commit diff
path: root/pkgs/servers/monitoring/prometheus/unbound-exporter.nix
blob: 952b9adc335b8691b18c58246a8a98b9b8fe6487 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ lib, stdenv, rustPlatform, fetchFromGitHub, openssl, pkg-config, nixosTests, Security }:

rustPlatform.buildRustPackage rec {
  pname = "unbound-telemetry";
  version = "unstable-2021-09-18";

  src = fetchFromGitHub {
    owner = "svartalf";
    repo = pname;
    rev = "19e53b05828a43b7062b67a9cc6c84836ca26439";
    sha256 = "sha256-wkr9T6GlJP/PSv17z3MC7vC0cXg/Z6rGlhlCUHH3Ua4=";
  };

  cargoSha256 = "sha256-6V39Wfqin2RK73rehsIwmqDkOin4FEiqJQjTKAEx9Vs=";

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ openssl ]
    ++ lib.optional stdenv.isDarwin Security;

  passthru.tests = {
    inherit (nixosTests.prometheus-exporters) unbound;
  };

  meta = with lib; {
    description = "Prometheus exporter for Unbound DNS resolver";
    homepage = "https://github.com/svartalf/unbound-telemetry";
    license = licenses.mit;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}