10 cfg = config.services.prometheus.exporters.py-air-control;
11 inherit (lib) mkOption types;
13 workingDir = "/var/lib/${cfg.stateDir}";
19 deviceHostname = mkOption {
21 example = "192.168.1.123";
23 The hostname of the air purification device from which to scrape the metrics.
30 The protocol to use when communicating with the air purification device.
31 Available: [http, coap, plain_coap]
36 default = "prometheus-py-air-control-exporter";
38 Directory below `/var/lib` to store runtime data.
39 This directory will be created automatically using systemd's StateDirectory mechanism.
46 StateDirectory = cfg.stateDir;
47 WorkingDirectory = workingDir;
49 ${pkgs.python3Packages.py-air-control-exporter}/bin/py-air-control-exporter \
50 --host ${cfg.deviceHostname} \
51 --protocol ${cfg.protocol} \
52 --listen-port ${toString cfg.port} \
53 --listen-address ${cfg.listenAddress}
55 Environment = [ "HOME=${workingDir}" ];