1 { config, lib, pkgs, utils, ... }:
3 inherit (lib) mkOption types;
4 cfg = config.services.prometheus.exporters.fritz;
5 yaml = pkgs.formats.yaml { };
6 configFile = yaml.generate "fritz-exporter.yaml" cfg.settings;
13 description = "Configuration settings for fritz-exporter.";
14 type = types.submodule {
15 freeformType = yaml.type;
18 # Pull existing port option into config file.
25 # Pull existing listen address option into config file.
26 listen_address = mkOption {
28 default = cfg.listenAddress;
32 log_level = mkOption {
33 type = types.enum [ "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL" ];
36 Log level to use for the exporter.
41 description = "Fritz!-devices to monitor using the exporter.";
42 type = with types; listOf (submodule {
43 freeformType = yaml.type;
50 Name to use for the device.
55 default = "fritz.box";
57 Hostname under which the target device is reachable.
63 Username to authenticate with the target device.
66 password_file = mkOption {
69 Path to a file which contains the password to authenticate with the target device.
70 Needs to be readable by the user the exporter runs under.
73 host_info = mkOption {
76 Enable extended host info for this device. *Warning*: This will heavily increase scrape time.
90 ExecStart = utils.escapeSystemdExecArgs ([
91 (lib.getExe pkgs.fritz-exporter)