9 cfg = config.services.prometheus.exporters.unbound;
22 (mkRemovedOptionModule [ "controlInterface" ] "This option was removed, use the `unbound.host` option instead.")
23 (mkRemovedOptionModule [ "fetchType" ] "This option was removed, use the `unbound.host` option instead.")
24 ({ options.warnings = options.warnings; options.assertions = options.assertions; })
29 telemetryPath = mkOption {
33 Path under which to expose metrics.
39 type = types.nullOr types.path;
40 default = "/var/lib/unbound/unbound_server.pem";
43 Path to the Unbound server certificate authority
47 certificate = mkOption {
48 type = types.nullOr types.path;
49 default = "/var/lib/unbound/unbound_control.pem";
52 Path to the Unbound control socket certificate
57 type = types.nullOr types.path;
58 default = "/var/lib/unbound/unbound_control.key";
61 Path to the Unbound control socket key.
67 default = "tcp://127.0.0.1:8953";
68 example = "unix:///run/unbound/unbound.socket";
70 Path to the unbound control socket. Supports unix domain sockets, as well as the TCP interface.
76 serviceOpts = mkMerge ([{
78 User = "unbound"; # to access the unbound_control.key
80 ${pkgs.prometheus-unbound-exporter}/bin/unbound_exporter \
81 --unbound.host "${cfg.unbound.host}" \
82 --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
83 --web.telemetry-path ${cfg.telemetryPath} \
84 ${optionalString (cfg.unbound.ca != null) "--unbound.ca ${cfg.unbound.ca}"} \
85 ${optionalString (cfg.unbound.certificate != null) "--unbound.cert ${cfg.unbound.certificate}"} \
86 ${optionalString (cfg.unbound.key != null) "--unbound.key ${cfg.unbound.key}"} \
87 ${toString cfg.extraFlags}
89 RestrictAddressFamilies = [
94 } // optionalAttrs (!config.services.unbound.enable) {
98 (mkIf config.services.unbound.enable {
99 after = [ "unbound.service" ];
100 requires = [ "unbound.service" ];