summary refs log tree commit diff
path: root/nixos/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-07-12 12:14:16 +0200
committerFlorian Klink <flokli@flokli.de>2020-07-12 12:16:26 +0200
commit3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b (patch)
treed722799e63ad99ffe748cc16d5f75d3eb849cc33 /nixos/modules/system/boot/systemd.nix
parenta2e8547c36a9c933f9c88d612ecb218dbefa0847 (diff)
downloadnixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.tar
nixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.tar.gz
nixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.tar.bz2
nixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.tar.lz
nixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.tar.xz
nixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.tar.zst
nixpkgs-3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b.zip
nixos/systemd: add missing defaults, make options nullable
Otherwise evaluation will fail if these are not set.
Diffstat (limited to 'nixos/modules/system/boot/systemd.nix')
-rw-r--r--nixos/modules/system/boot/systemd.nix20
1 files changed, 12 insertions, 8 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 020cf38ea3f..01ecf1d0292 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -819,7 +819,8 @@ in
     };
 
     systemd.watchdog.device = mkOption {
-      type = types.path;
+      type = types.nullOr types.path;
+      default = null;
       example = "/dev/watchdog";
       description = ''
         The path to a hardware watchdog device which will be managed by systemd.
@@ -828,7 +829,8 @@ in
     };
 
     systemd.watchdog.runtimeTime = mkOption {
-      type = types.str;
+      type = types.nullOr types.str;
+      default = null;
       example = "30s";
       description = ''
         The amount of time which can elapse before a watchdog hardware device
@@ -838,7 +840,8 @@ in
     };
 
     systemd.watchdog.rebootTime = mkOption {
-      type = types.str;
+      type = types.nullOr types.str;
+      default = null;
       example = "10m";
       description = ''
         The amount of time which can elapse after a reboot has been triggered
@@ -848,7 +851,8 @@ in
     };
 
     systemd.watchdog.kexecTime = mkOption {
-      type = types.str;
+      type = types.nullOr types.str;
+      default = null;
       example = "10m";
       description = ''
         The amount of time which can elapse when kexec is being executed before
@@ -928,16 +932,16 @@ in
           DefaultIPAccounting=yes
         ''}
         DefaultLimitCORE=infinity
-        ${optionalString (config.systemd.watchdog.device != "") ''
+        ${optionalString (config.systemd.watchdog.device != null) ''
           WatchdogDevice=${config.systemd.watchdog.device}
         ''}
-        ${optionalString (config.systemd.watchdog.runtimeTime != "") ''
+        ${optionalString (config.systemd.watchdog.runtimeTime != null) ''
           RuntimeWatchdogSec=${config.systemd.watchdog.runtimeTime}
         ''}
-        ${optionalString (config.systemd.watchdog.rebootTime != "") ''
+        ${optionalString (config.systemd.watchdog.rebootTime != null) ''
           RebootWatchdogSec=${config.systemd.watchdog.rebootTime}
         ''}
-        ${optionalString (config.systemd.watchdog.kexecTime != "") ''
+        ${optionalString (config.systemd.watchdog.kexecTime != null) ''
           KExecWatchdogSec=${config.systemd.watchdog.kexecTime}
         ''}