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