forked from mirrors/nixpkgs
cron.nix: Use the new option scheme.
svn path=/nixos/trunk/; revision=13235
This commit is contained in:
parent
2e6c2f9aaf
commit
866987a60e
|
@ -626,29 +626,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
cron = {
|
|
||||||
|
|
||||||
mailto = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = " The job output will be mailed to this email address. ";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemCronJobs = mkOption {
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
"* * * * * test ls -l / > /tmp/cronout 2>&1"
|
|
||||||
"* * * * * eelco echo Hello World > /home/eelco/cronout"
|
|
||||||
];
|
|
||||||
description = ''
|
|
||||||
A list of Cron jobs to be appended to the system-wide
|
|
||||||
crontab. See the manual page for crontab for the expected
|
|
||||||
format. If you want to get the results mailed you must setuid
|
|
||||||
sendmail. See <option>security.setuidOwners</option>
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
atd = {
|
atd = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
@ -3067,7 +3044,11 @@ root ALL=(ALL) SETENV: ALL
|
||||||
require = [
|
require = [
|
||||||
# newtworking
|
# newtworking
|
||||||
(import ../upstart-jobs/dhclient.nix)
|
(import ../upstart-jobs/dhclient.nix)
|
||||||
|
|
||||||
# hardware
|
# hardware
|
||||||
(import ../upstart-jobs/pcmcia.nix)
|
(import ../upstart-jobs/pcmcia.nix)
|
||||||
|
|
||||||
|
# services
|
||||||
|
(import ../upstart-jobs/cron.nix)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,6 @@ rec {
|
||||||
pkgs.bzip2
|
pkgs.bzip2
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.cpio
|
pkgs.cpio
|
||||||
pkgs.cron
|
|
||||||
pkgs.curl
|
pkgs.curl
|
||||||
pkgs.e2fsprogs
|
pkgs.e2fsprogs
|
||||||
pkgs.findutils
|
pkgs.findutils
|
||||||
|
|
|
@ -1,7 +1,39 @@
|
||||||
{pkgs, config}:
|
{pkgs, config}:
|
||||||
|
|
||||||
|
###### interface
|
||||||
let
|
let
|
||||||
|
inherit (pkgs.lib) mkOption;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
services = {
|
||||||
|
cron = {
|
||||||
|
|
||||||
|
mailto = mkOption {
|
||||||
|
default = "";
|
||||||
|
description = " The job output will be mailed to this email address. ";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemCronJobs = mkOption {
|
||||||
|
default = [];
|
||||||
|
example = [
|
||||||
|
"* * * * * test ls -l / > /tmp/cronout 2>&1"
|
||||||
|
"* * * * * eelco echo Hello World > /home/eelco/cronout"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
A list of Cron jobs to be appended to the system-wide
|
||||||
|
crontab. See the manual page for crontab for the expected
|
||||||
|
format. If you want to get the results mailed you must setuid
|
||||||
|
sendmail. See <option>security.setuidOwners</option>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
let
|
||||||
# !!! This should be defined somewhere else.
|
# !!! This should be defined somewhere else.
|
||||||
locatedb = "/var/cache/locatedb";
|
locatedb = "/var/cache/locatedb";
|
||||||
|
|
||||||
|
@ -27,9 +59,17 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "cron";
|
require = [
|
||||||
|
# (import ../upstart-jobs/default.nix) # config.services.extraJobs
|
||||||
|
# (import ?) # config.time.timeZone
|
||||||
|
# (import ?) # config.environment.etc
|
||||||
|
# (import ?) # config.environment.extraPackages
|
||||||
|
# (import ?) # config.environment.cleanStart
|
||||||
|
options
|
||||||
|
];
|
||||||
|
|
||||||
extraEtc = [
|
environment = {
|
||||||
|
etc = [
|
||||||
# The system-wide crontab.
|
# The system-wide crontab.
|
||||||
{ source = systemCronJobsFile;
|
{ source = systemCronJobsFile;
|
||||||
target = "crontab";
|
target = "crontab";
|
||||||
|
@ -37,6 +77,16 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
extraPackages =
|
||||||
|
pkgs.lib.optional
|
||||||
|
(!config.environment.cleanStart)
|
||||||
|
pkgs.cron;
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
extraJobs = [{
|
||||||
|
name = "cron";
|
||||||
|
|
||||||
job = ''
|
job = ''
|
||||||
description "Cron daemon"
|
description "Cron daemon"
|
||||||
|
|
||||||
|
@ -48,4 +98,6 @@ in
|
||||||
|
|
||||||
respawn ${pkgs.cron}/sbin/cron -n
|
respawn ${pkgs.cron}/sbin/cron -n
|
||||||
'';
|
'';
|
||||||
|
}];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,11 +140,6 @@ let
|
||||||
inherit config pkgs nix nixEnvVars;
|
inherit config pkgs nix nixEnvVars;
|
||||||
})
|
})
|
||||||
|
|
||||||
# Cron daemon.
|
|
||||||
(import ../upstart-jobs/cron.nix {
|
|
||||||
inherit config pkgs;
|
|
||||||
})
|
|
||||||
|
|
||||||
# Name service cache daemon.
|
# Name service cache daemon.
|
||||||
(import ../upstart-jobs/nscd.nix {
|
(import ../upstart-jobs/nscd.nix {
|
||||||
inherit (pkgs) glibc;
|
inherit (pkgs) glibc;
|
||||||
|
|
Loading…
Reference in a new issue