8 cfg = config.services.prometheus.exporters.dnssec;
9 configFormat = pkgs.formats.toml { };
10 configFile = configFormat.generate "dnssec-checks.toml" cfg.configuration;
15 configuration = lib.mkOption {
16 type = lib.types.nullOr lib.types.attrs;
19 dnssec exporter configuration as nix attribute set.
21 See <https://github.com/chrj/prometheus-dnssec-exporter/blob/master/README.md>
22 for the description of the configuration file format.
24 example = lib.literalExpression ''
33 zone = "verisigninc.com";
42 listenAddress = lib.mkOption {
43 type = lib.types.nullOr lib.types.str;
46 Listen address as host IP and port definition.
51 resolvers = lib.mkOption {
52 type = lib.types.listOf lib.types.str;
55 DNSSEC capable resolver to be used for the check.
57 example = [ "0.0.0.0:53" ];
60 timeout = lib.mkOption {
61 type = lib.types.nullOr lib.types.str;
64 DNS request timeout duration.
69 extraFlags = lib.mkOption {
70 type = lib.types.listOf lib.types.str;
73 Extra commandline options when launching Prometheus.
81 startScript = pkgs.writeShellScriptBin "prometheus-dnssec-exporter-start" "${lib.concatStringsSep
84 [ "${pkgs.prometheus-dnssec-exporter}/bin/prometheus-dnssec-exporter" ]
85 ++ lib.optionals (cfg.configuration != null) [ "-config ${configFile}" ]
86 ++ lib.optionals (cfg.listenAddress != null) [
87 "-listen-address ${lib.escapeShellArg cfg.listenAddress}"
89 ++ lib.optionals (cfg.resolvers != [ ]) [
90 "-resolvers ${lib.escapeShellArg (lib.concatStringsSep "," cfg.resolvers)}"
92 ++ lib.optionals (cfg.timeout != null) [ "-timeout ${lib.escapeShellArg cfg.timeout}" ]
98 ExecStart = lib.getExe startScript;