diff options
Diffstat (limited to 'nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix')
-rw-r--r-- | nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix index 8c88f47ab86a..f6dd6f7eb994 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix @@ -1,9 +1,19 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.mail; + inherit (lib) + mkOption + types + mapAttrs' + nameValuePair + toLower + filterAttrs + escapeShellArg + literalExpression + mkIf + concatStringsSep + ; configFile = if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configFile); @@ -22,41 +32,41 @@ let serverOptions.options = { name = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Value for label 'configname' which will be added to all metrics. ''; }; server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Hostname of the server that should be probed. ''; }; port = mkOption { type = types.port; example = 587; - description = lib.mdDoc '' + description = '' Port to use for SMTP. ''; }; from = mkOption { type = types.str; example = "exporteruser@domain.tld"; - description = lib.mdDoc '' + description = '' Content of 'From' Header for probing mails. ''; }; to = mkOption { type = types.str; example = "exporteruser@domain.tld"; - description = lib.mdDoc '' + description = '' Content of 'To' Header for probing mails. ''; }; detectionDir = mkOption { type = types.path; example = "/var/spool/mail/exporteruser/new"; - description = lib.mdDoc '' + description = '' Directory in which new mails for the exporter user are placed. Note that this needs to exist when the exporter starts. ''; @@ -65,14 +75,14 @@ let type = types.nullOr types.str; default = null; example = "exporteruser@domain.tld"; - description = lib.mdDoc '' + description = '' Username to use for SMTP authentication. ''; }; passphrase = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Password to use for SMTP authentication. ''; }; @@ -82,20 +92,20 @@ let monitoringInterval = mkOption { type = types.str; example = "10s"; - description = lib.mdDoc '' + description = '' Time interval between two probe attempts. ''; }; mailCheckTimeout = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Timeout until mails are considered "didn't make it". ''; }; disableFileDeletion = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Disables the exporter's function to delete probing mails. ''; }; @@ -112,7 +122,7 @@ let detectionDir = "/path/to/Maildir/new"; } ] ''; - description = lib.mdDoc '' + description = '' List of servers that should be probed. *Note:* if your mailserver has {manpage}`rspamd(8)` configured, @@ -141,28 +151,28 @@ in environmentFile = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' File containing env-vars to be substituted into the exporter's config. ''; }; configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specify the mailexporter configuration file to use. ''; }; configuration = mkOption { type = types.nullOr (types.submodule exporterOptions); default = null; - description = lib.mdDoc '' + description = '' Specify the mailexporter configuration file to use. ''; }; telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; |