1 { config, lib, pkgs, options, ... }:
4 cfg = config.services.prometheus.exporters.pihole;
14 (mkRemovedOptionModule [ "interval"] "This option has been removed.")
15 ({ options.warnings = options.warnings; options.assertions = options.assertions; })
23 example = "580a770cb40511eb85290242ac130003580a770cb40511eb85290242ac130003";
25 Pi-Hole API token which can be used instead of a password
33 The password to login into Pi-Hole. An api token can be used instead.
36 piholeHostname = mkOption {
39 example = "127.0.0.1";
41 Hostname or address where to find the Pi-Hole webinterface
44 piholePort = mkOption {
49 The port Pi-Hole webinterface is reachable on
53 type = types.enum [ "http" "https" ];
57 The protocol which is used to connect to Pi-Hole
64 Controls the timeout to connect to a Pi-Hole instance
71 ${pkgs.prometheus-pihole-exporter}/bin/pihole-exporter \
72 ${optionalString (cfg.apiToken != "") "-pihole_api_token ${cfg.apiToken}"} \
73 -pihole_hostname ${cfg.piholeHostname} \
74 ${optionalString (cfg.password != "") "-pihole_password ${cfg.password}"} \
75 -pihole_port ${toString cfg.piholePort} \
76 -pihole_protocol ${cfg.protocol} \
77 -port ${toString cfg.port} \
78 -timeout ${cfg.timeout}