added system cron mailto option

svn path=/nixos/trunk/; revision=13114
This commit is contained in:
Marc Weber 2008-10-25 22:03:12 +00:00
parent 1d55390e1c
commit 32b263e429
2 changed files with 8 additions and 2 deletions

View File

@ -654,6 +654,11 @@ in
cron = {
mailto = mkOption {
default = "";
description = " The job output will be mailed to this email address. ";
};
systemCronJobs = mkOption {
default = [];
example = [
@ -663,7 +668,8 @@ in
description = ''
A list of Cron jobs to be appended to the system-wide
crontab. See the manual page for crontab for the expected
format.
format. If you want to get the results mailed you must setuid
sendmail. See <option>security.setuidOwners</option>
'';
};

View File

@ -20,7 +20,7 @@ let
systemCronJobsFile = pkgs.writeText "system-crontab" ''
SHELL=${pkgs.bash}/bin/sh
PATH=${pkgs.coreutils}/bin:${pkgs.findutils}/bin:${pkgs.gnused}/bin:${pkgs.su}/bin
MAILTO=
MAILTO="${config.services.cron.mailto}"
${pkgs.lib.concatStrings (map (job: job + "\n") systemCronJobs)}
'';