From 70a2ad789877422ebe7b76fa8be09637ab4c4665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 10 Oct 2010 11:08:10 +0000 Subject: [PATCH] Requiring nixpkgs 24196, I made nixos set the sendmail path to vixie cron, so now vixie cron can send mail properly, for example if a user enabled the 'postfix' service. svn path=/nixos/trunk/; revision=24197 --- modules/services/scheduling/cron.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/services/scheduling/cron.nix b/modules/services/scheduling/cron.nix index e769caefdf59..c6af4995079e 100644 --- a/modules/services/scheduling/cron.nix +++ b/modules/services/scheduling/cron.nix @@ -15,6 +15,13 @@ let NIX_CONF_DIR=/nix/etc/nix ${pkgs.lib.concatStrings (map (job: job + "\n") config.services.cron.systemCronJobs)} ''; + + # Vixie cron requires build-time configuration for the sendmail path. + cronNixosPkg = pkgs.cron.override { + # The mail.nix nixos module, if there is any local mail system enabled, + # should have sendmail in this path. + sendmailPath = "/var/setuid-wrappers/sendmail"; + }; in @@ -65,7 +72,7 @@ in mode = "0600"; # Cron requires this. }; - environment.systemPackages = [pkgs.cron]; + environment.systemPackages = [ cronNixosPkg ]; jobs.cron = { description = "Cron daemon"; @@ -86,7 +93,7 @@ in fi ''; - exec = "${pkgs.cron}/sbin/cron -n"; + exec = "${cronNixosPkg}/sbin/cron -n"; }; };