diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-01 16:51:10 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-01 16:51:10 +0100 |
commit | a806adad2017413071d20d519d9a5d9b6b937474 (patch) | |
tree | d6a23660977c0e78e770783058965d92de243dbd /overlays/nftables-prometheus-exporter/default.nix | |
parent | c389674935494e1246d156515e25ead60551e705 (diff) | |
download | nixos-a806adad2017413071d20d519d9a5d9b6b937474.tar nixos-a806adad2017413071d20d519d9a5d9b6b937474.tar.gz nixos-a806adad2017413071d20d519d9a5d9b6b937474.tar.bz2 nixos-a806adad2017413071d20d519d9a5d9b6b937474.tar.xz nixos-a806adad2017413071d20d519d9a5d9b6b937474.zip |
vidhar: prometheus: nftables
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 | } | ||