summaryrefslogtreecommitdiff
path: root/overlays/zte-prometheus-exporter/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/zte-prometheus-exporter/default.nix')
-rw-r--r--overlays/zte-prometheus-exporter/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/overlays/zte-prometheus-exporter/default.nix b/overlays/zte-prometheus-exporter/default.nix
new file mode 100644
index 00000000..1609724b
--- /dev/null
+++ b/overlays/zte-prometheus-exporter/default.nix
@@ -0,0 +1,28 @@
1final: prev:
2let
3 packageOverrides = final.callPackage ./python-packages.nix {};
4 inpPython = final.python310.override { inherit packageOverrides; };
5in {
6 zte-prometheus-exporter = prev.stdenv.mkDerivation rec {
7 name = "zte-prometheus-exporter";
8 src = ./zte-prometheus-exporter.py;
9
10 phases = [ "buildPhase" "checkPhase" "installPhase" ];
11
12 python = inpPython.withPackages (ps: with ps; [pytimeparse requests]);
13
14 buildPhase = ''
15 substituteAll $src zte-prometheus-exporter
16 '';
17
18 doCheck = true;
19 checkPhase = ''
20 ${python}/bin/python -m py_compile zte-prometheus-exporter
21 '';
22
23 installPhase = ''
24 install -m 0755 -D -t $out/bin \
25 zte-prometheus-exporter
26 '';
27 };
28}