2021-08-23 12:29:22 +02:00
|
|
|
{ stdenv, fetchFromGitHub, lib, python3, nixosTests }:
|
2021-03-05 13:06:20 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-03-07 22:12:09 +01:00
|
|
|
pname = "knot-exporter";
|
2021-08-23 12:29:22 +02:00
|
|
|
version = "unstable-2021-08-21";
|
2021-03-05 13:06:20 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ghedo";
|
|
|
|
repo = "knot_exporter";
|
2021-08-23 12:29:22 +02:00
|
|
|
rev = "b18eb7db735b50280f0815497475f4c7092a6550";
|
|
|
|
sha256 = "sha256-FGzkO/KHDhkM3PA2urNQcrMi3MHADkd0YwAvu1jvfrU=";
|
2021-03-05 13:06:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ python3.pkgs.wrapPython ];
|
|
|
|
buildInputs = [ python3 ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm0755 knot_exporter $out/bin/knot_exporter
|
|
|
|
patchShebangs $out/bin
|
2021-08-26 02:08:48 +02:00
|
|
|
buildPythonPath ${python3.pkgs.prometheus-client}
|
2021-03-05 13:06:20 +01:00
|
|
|
patchPythonScript $out/bin/knot_exporter
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-03-11 18:39:17 +01:00
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) knot; };
|
|
|
|
|
2021-03-05 13:06:20 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/ghedo/knot_exporter";
|
|
|
|
description = " Prometheus exporter for Knot DNS";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ ma27 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|