From 408b8b5725c3e6fff75aef772da248d3e95ff414 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 30 Oct 2013 17:37:45 +0100 Subject: Add lots of missing option types --- nixos/modules/services/scheduling/atd.nix | 11 +++++++---- nixos/modules/services/scheduling/cron.nix | 22 ++++++++++++++-------- nixos/modules/services/scheduling/fcron.nix | 17 ++++++++++++----- 3 files changed, 33 insertions(+), 17 deletions(-) (limited to 'nixos/modules/services/scheduling') diff --git a/nixos/modules/services/scheduling/atd.nix b/nixos/modules/services/scheduling/atd.nix index 8c96252668e3..c516c5889f12 100644 --- a/nixos/modules/services/scheduling/atd.nix +++ b/nixos/modules/services/scheduling/atd.nix @@ -17,18 +17,21 @@ in options = { services.atd.enable = mkOption { + type = types.bool; default = false; description = '' - Whether to enable the `at' daemon, a command scheduler. + Whether to enable the at daemon, a command scheduler. ''; }; services.atd.allowEveryone = mkOption { + type = types.bool; default = false; description = '' - Whether to make /var/spool/at{jobs,spool} writeable - by everyone (and sticky). This is normally not needed since - the `at' commands are setuid/setgid `atd'. + Whether to make /var/spool/at{jobs,spool} + writeable by everyone (and sticky). This is normally not + needed since the at commands are + setuid/setgid atd. ''; }; diff --git a/nixos/modules/services/scheduling/cron.nix b/nixos/modules/services/scheduling/cron.nix index e14f03fb1e83..44ed1ba5a078 100644 --- a/nixos/modules/services/scheduling/cron.nix +++ b/nixos/modules/services/scheduling/cron.nix @@ -11,7 +11,9 @@ let '' 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)} ''; @@ -34,21 +36,25 @@ in services.cron = { enable = mkOption { + type = types.bool; default = true; - description = "Whether to enable the `vixie cron' daemon."; + description = "Whether to enable the Vixie cron daemon."; }; mailto = mkOption { - default = ""; - description = " The job output will be mailed to this email address. "; + type = types.nullOr types.str; + default = null; + description = "Email address to which job output will be mailed."; }; systemCronJobs = mkOption { + type = types.listOf types.str; default = []; - example = [ - "* * * * * test ls -l / > /tmp/cronout 2>&1" - "* * * * * eelco echo Hello World > /home/eelco/cronout" - ]; + example = literalExample '' + [ "* * * * * 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 diff --git a/nixos/modules/services/scheduling/fcron.nix b/nixos/modules/services/scheduling/fcron.nix index 95ff918eb6d7..0c0811ca6e0e 100644 --- a/nixos/modules/services/scheduling/fcron.nix +++ b/nixos/modules/services/scheduling/fcron.nix @@ -6,7 +6,7 @@ let cfg = config.services.fcron; - queuelen = if cfg.queuelen == "" then "" else "-q ${toString cfg.queuelen}"; + queuelen = if cfg.queuelen == null then "" else "-q ${toString cfg.queuelen}"; systemCronJobs = '' @@ -34,33 +34,40 @@ in services.fcron = { enable = mkOption { + type = types.bool; default = false; - description = "Whether to enable the `fcron' daemon."; + description = "Whether to enable the fcron daemon."; }; allow = mkOption { + type = types.listOf types.str; default = [ "all" ]; description = '' - Users allowed to use fcrontab and fcrondyn (one name per line, "all" for everyone). + Users allowed to use fcrontab and fcrondyn (one name per + line, all for everyone). ''; }; deny = mkOption { + type = types.listOf types.str; default = []; description = "Users forbidden from using fcron."; }; maxSerialJobs = mkOption { + type = types.int; default = 1; description = "Maximum number of serial jobs which can run simultaneously."; }; queuelen = mkOption { - default = ""; - description = "Number of jobs the serial queue and the lavg queue can contain - empty to net set this number (-q)"; + type = types.nullOr types.int; + default = null; + description = "Number of jobs the serial queue and the lavg queue can contain."; }; systab = mkOption { + type = types.lines; default = ""; description = ''The "system" crontab contents.''; }; -- cgit 1.4.1