summary refs log tree commit diff
path: root/nixos/modules/services/scheduling/cron.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 17:37:45 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 18:47:43 +0100
commit408b8b5725c3e6fff75aef772da248d3e95ff414 (patch)
tree692e3b61dbbff85cc97e3becf13a1376dea04a92 /nixos/modules/services/scheduling/cron.nix
parentd882e1966251880240599d3c1b31e060661506ee (diff)
downloadnixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.gz
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.bz2
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.lz
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.xz
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.tar.zst
nixpkgs-408b8b5725c3e6fff75aef772da248d3e95ff414.zip
Add lots of missing option types
Diffstat (limited to 'nixos/modules/services/scheduling/cron.nix')
-rw-r--r--nixos/modules/services/scheduling/cron.nix22
1 files changed, 14 insertions, 8 deletions
diff --git a/nixos/modules/services/scheduling/cron.nix b/nixos/modules/services/scheduling/cron.nix
index e14f03fb1e8..44ed1ba5a07 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