1 { config, lib, pkgs, options, ... }:
4 cfg = config.services.prometheus.exporters.tor;
5 inherit (lib) mkOption types concatStringsSep;
10 torControlAddress = mkOption {
12 default = "127.0.0.1";
14 Tor control IP address or hostname.
18 torControlPort = mkOption {
29 ${pkgs.prometheus-tor-exporter}/bin/prometheus-tor-exporter \
30 -b ${cfg.listenAddress} \
31 -p ${toString cfg.port} \
32 -a ${cfg.torControlAddress} \
33 -c ${toString cfg.torControlPort} \
34 ${concatStringsSep " \\\n " cfg.extraFlags}
38 # CPython requires a process to either have $HOME defined or run as a UID
39 # defined in /etc/passwd. The latter is false with DynamicUser, so define a
40 # dummy $HOME. https://bugs.python.org/issue10496
41 environment = { HOME = "/var/empty"; };