nixos/prometheus-mail-exporter: misc fixes

- Fix misspelled option. mkRenamedOptionModule is not used because the
   option hasn't really worked before.
 - Add missing cfg.telemetryPath arg to ExecStart.
 - Fix mkdir invocation in test.
This commit is contained in:
Martin Milata 2020-03-06 01:24:48 +01:00
parent 3b5cf35e8b
commit e7ed7901a8
2 changed files with 3 additions and 2 deletions

View file

@ -90,7 +90,7 @@ let
Timeout until mails are considered "didn't make it". Timeout until mails are considered "didn't make it".
''; '';
}; };
disableFileDelition = mkOption { disableFileDeletion = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = ''
@ -147,6 +147,7 @@ in
ExecStart = '' ExecStart = ''
${pkgs.prometheus-mail-exporter}/bin/mailexporter \ ${pkgs.prometheus-mail-exporter}/bin/mailexporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
--config.file ${ --config.file ${
if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configFile) if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configFile)
} \ } \

View file

@ -224,7 +224,7 @@ let
after = [ "postfix.service" ]; after = [ "postfix.service" ];
requires = [ "postfix.service" ]; requires = [ "postfix.service" ];
preStart = '' preStart = ''
mkdir -p 0600 mail-exporter/new mkdir -p -m 0700 mail-exporter/new
''; '';
serviceConfig = { serviceConfig = {
ProtectHome = true; ProtectHome = true;