diff options
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/exporters/mpd.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/mpd.nix b/nixos/modules/services/monitoring/prometheus/exporters/mpd.nix new file mode 100644 index 000000000000..7b459d86a07d --- /dev/null +++ b/nixos/modules/services/monitoring/prometheus/exporters/mpd.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, options }: + +with lib; +let + cfg = config.services.prometheus.exporters.mpd; +in +{ + port = 9806; + extraOpts = { + port = mkOption { + type = types.port; + default = "9806"; + description = '' + Port to bind to + ''; + }; + + host = mkOption { + type = types.str; + default = "127.0.0.1"; + description = '' + Address to bind to + ''; + }; + + mpdPort = mkOption { + type = types.port; + default = 6600; + description = '' + Port of the MPD server + ''; + }; + + mpdHost = mkOption { + type = types.str; + default = "127.0.0.1"; + description = '' + Address of the MPD server + ''; + }; + + }; + + serviceOpts.serviceConfig.ExecStart = ''${pkgs.prometheus-mpd-exporter}/bin/prometheus-mpd-exporter \ + --bind-addr ${cfg.host} \ + --bind-port ${builtins.toString cfg.port} \ + --mpd-server-addr ${cfg.mpdHost} \ + --mpd-server-port ${builtins.toString cfg.mpdPort} + ''; +} + |