diff options
author | WilliButz <WilliButz@users.noreply.github.com> | 2020-12-12 21:48:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 21:48:01 +0100 |
commit | 8727a0178f28a986cb49d102664e3ff4243b218e (patch) | |
tree | c859ec46bcda8816f88209ed15eb306159dcf878 /nixos | |
parent | e8fbbe396b7d6f9f821cba04caa026a1da706e5f (diff) | |
parent | 4970fbedbcab6f7a9d4030952c0a01c33b0f4e97 (diff) |
Merge pull request #106788 from urbas/py-air-control-exporter-cli
nixos/prometheus-exporters/py-air-control: invoke exporter command
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix b/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix index d9a627ca2eaf..d9ab99221d9d 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix @@ -5,10 +5,6 @@ with lib; let cfg = config.services.prometheus.exporters.py-air-control; - py-air-control-exporter-env = pkgs.python3.withPackages (pyPkgs: [ - pyPkgs.py-air-control-exporter - ]); - workingDir = "/var/lib/${cfg.stateDir}"; in @@ -45,18 +41,13 @@ in StateDirectory = cfg.stateDir; WorkingDirectory = workingDir; ExecStart = '' - ${py-air-control-exporter-env}/bin/python -c \ - "from py_air_control_exporter import app; app.create_app().run( \ - debug=False, \ - port=${toString cfg.port}, \ - host='${cfg.listenAddress}', \ - )" + ${pkgs.python3Packages.py-air-control-exporter}/bin/py-air-control-exporter \ + --host ${cfg.deviceHostname} \ + --protocol ${cfg.protocol} \ + --listen-port ${toString cfg.port} \ + --listen-address ${cfg.listenAddress} ''; - Environment = [ - "PY_AIR_CONTROL_HOST=${cfg.deviceHostname}" - "PY_AIR_CONTROL_PROTOCOL=${cfg.protocol}" - "HOME=${workingDir}" - ]; + Environment = [ "HOME=${workingDir}" ]; }; }; } |