2020-06-18 10:48:40 +00:00
|
|
|
{ lib, fetchFromGitHub, python3Packages, nixosTests }:
|
2018-10-13 08:07:05 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
2021-07-25 21:53:02 +00:00
|
|
|
pname = "tor-exporter";
|
2019-07-05 04:49:04 +00:00
|
|
|
version = "0.4";
|
2018-10-13 08:07:05 +00:00
|
|
|
|
|
|
|
# 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";
|
2019-07-05 04:49:04 +00:00
|
|
|
sha256 = "1gzf42z0cgdqijbi9cwpjkqzkvnabaxkkfa5ac5h27r3pxx3q4n0";
|
2018-10-13 08:07:05 +00:00
|
|
|
};
|
|
|
|
|
2021-08-26 00:08:48 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [ prometheus-client stem retrying ];
|
2018-10-13 08:07:05 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2020-06-18 10:48:40 +00:00
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) tor; };
|
|
|
|
|
2018-10-13 08:07:05 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Prometheus exporter that exposes metrics from a Tor daemon";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/atx/prometheus-tor_exporter";
|
2018-10-13 08:07:05 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ delroth ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|