fcron: Fix error when cron.mailto is null.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
This commit is contained in:
Moritz Ulrich 2013-11-04 12:07:03 +01:00
parent 268bb64b68
commit 882c2b7278
No known key found for this signature in database
GPG key ID: A9E1CC79ECBFA432

View file

@ -8,11 +8,14 @@ let
queuelen = if cfg.queuelen == null then "" else "-q ${toString cfg.queuelen}";
# Duplicate code, also found in cron.nix. Needs deduplication.
systemCronJobs =
''
SHELL=${pkgs.bash}/bin/bash
PATH=${config.system.path}/bin:${config.system.path}/sbin
MAILTO="${config.services.cron.mailto}"
${optionalString (config.services.cron.mailto != null) ''
MAILTO="${config.services.cron.mailto}"
''}
NIX_CONF_DIR=/etc/nix
${pkgs.lib.concatStrings (map (job: job + "\n") config.services.cron.systemCronJobs)}
'';