@@ -0,0 +1,37 @@
1+{ stdenv, fetchFromGitHub, lib, python3 }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "knot-exporter-unstable";
5+ version = "2020-01-30";
6+
7+ src = fetchFromGitHub {
8+ owner = "ghedo";
9+ repo = "knot_exporter";
10+ rev = "21dd46b401e0c1aea0b173e19462cdf89e1f444e";
11+ sha256 = "sha256-4au4lpaq3jcqC2JXdCcf8h+YN8Nmm4eE0kZwA+1rWlc=";
12+ };
13+
14+ dontBuild = true;
15+
16+ nativeBuildInputs = [ python3.pkgs.wrapPython ];
17+ buildInputs = [ python3 ];
18+
19+ installPhase = ''
20+ runHook preInstall
21+
22+ install -Dm0755 knot_exporter $out/bin/knot_exporter
23+ patchShebangs $out/bin
24+ buildPythonPath ${python3.pkgs.prometheus_client}
25+ patchPythonScript $out/bin/knot_exporter
26+
27+ runHook postInstall
28+ '';
29+
30+ meta = with lib; {
31+ homepage = "https://github.com/ghedo/knot_exporter";
32+ description = " Prometheus exporter for Knot DNS";
33+ license = licenses.gpl3Only;
34+ maintainers = with maintainers; [ ma27 ];
35+ platforms = platforms.linux;
36+ };
37+}