diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2018-10-17 08:04:22 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2018-10-17 08:04:22 +0200 |
commit | 18fcc337affa09238a42e9a0ca21e08363c65eeb (patch) | |
tree | ddab7a25b417b95e708f33752b70327f5acaf55a /pkgs/servers/monitoring | |
parent | 71f67f178df91c42ff230c41ab724dd3a90a5bb5 (diff) | |
parent | 1ba50fe163b03b4e1083c8baaa112c827f5197ab (diff) | |
download | nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.gz nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.bz2 nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.lz nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.xz nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.zst nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.zip |
Merge master into staging-next
Diffstat (limited to 'pkgs/servers/monitoring')
-rw-r--r-- | pkgs/servers/monitoring/prometheus/tor-exporter.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/servers/monitoring/prometheus/tor-exporter.nix b/pkgs/servers/monitoring/prometheus/tor-exporter.nix new file mode 100644 index 000000000000..88f469ebe179 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/tor-exporter.nix @@ -0,0 +1,37 @@ +{ lib, fetchFromGitHub, python3Packages }: + +python3Packages.buildPythonApplication rec { + name = "tor-exporter-${version}"; + version = "0.3"; + + # Just a single .py file to use as the application's main entry point. + format = "other"; + + src = fetchFromGitHub { + rev = "v${version}"; + owner = "atx"; + repo = "prometheus-tor_exporter"; + sha256 = "0d7pk8s8ya2pm8b4ijbfdniqcbd3vqy15dlhnmaf4wgb51pmm5yv"; + }; + + propagatedBuildInputs = with python3Packages; [ prometheus_client stem retrying ]; + + installPhase = '' + mkdir -p $out/share/ + cp prometheus-tor-exporter.py $out/share/ + ''; + + fixupPhase = '' + makeWrapper "${python3Packages.python.interpreter}" "$out/bin/prometheus-tor-exporter" \ + --set PYTHONPATH "$PYTHONPATH" \ + --add-flags "$out/share/prometheus-tor-exporter.py" + ''; + + meta = with lib; { + description = "Prometheus exporter that exposes metrics from a Tor daemon"; + homepage = https://github.com/atx/prometheus-tor_exporter; + license = licenses.mit; + maintainers = with maintainers; [ delroth ]; + platforms = platforms.unix; + }; +} |