summaryrefslogtreecommitdiff
path: root/overlays/nftables-prometheus-exporter/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-01-01 16:51:10 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-01-01 16:51:10 +0100
commita806adad2017413071d20d519d9a5d9b6b937474 (patch)
treed6a23660977c0e78e770783058965d92de243dbd /overlays/nftables-prometheus-exporter/default.nix
parentc389674935494e1246d156515e25ead60551e705 (diff)
downloadnixos-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.nix27
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 @@
1final: prev:
2let
3 inpPython = final.python310;
4in {
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}