add ifEnable to fcron job

svn path=/nixos/trunk/; revision=13383
This commit is contained in:
Marc Weber 2008-11-24 09:07:28 +00:00
parent eea7e6c213
commit 9fefbf1379
1 changed files with 3 additions and 2 deletions

View File

@ -59,6 +59,7 @@ let
#systemCronJobs = #systemCronJobs =
# config.services.cron.systemCronJobs; # config.services.cron.systemCronJobs;
cfg = config.services.fcron; cfg = config.services.fcron;
ifEnabled = if cfg.enable then pkgs.lib.id else (x : []);
queuelen = if cfg.queuelen == "" then "" else "-q ${toString cfg.queuelen}"; queuelen = if cfg.queuelen == "" then "" else "-q ${toString cfg.queuelen}";
# shell is set to /sh in config.. # shell is set to /sh in config..
@ -87,7 +88,7 @@ in
]; ];
environment = { environment = {
etc = [ etc = ifEnabled [
(allowdeny "allow" (["root"] ++ cfg.allow)) (allowdeny "allow" (["root"] ++ cfg.allow))
(allowdeny "deny" cfg.deny) (allowdeny "deny" cfg.deny)
# see man 5 fcron.conf # see man 5 fcron.conf
@ -113,7 +114,7 @@ in
}; };
services = { services = {
extraJobs = [{ extraJobs = ifEnabled [{
name = "fcron"; name = "fcron";
job = '' job = ''