0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-20 00:50:38 +03:00
nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/shelly.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
595 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
options,
...
}:
let
cfg = config.services.prometheus.exporters.shelly;
inherit (lib) mkOption types;
in
{
port = 9784;
extraOpts = {
metrics-file = mkOption {
type = types.path;
description = ''
Path to the JSON file with the metric definitions
'';
};
};
serviceOpts = {
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-shelly-exporter}/bin/shelly_exporter \
-metrics-file ${cfg.metrics-file} \
-listen-address ${cfg.listenAddress}:${toString cfg.port}
'';
};
};
}