From 3b2b3f7c535006f8a6a1c79a2a41601f68ba7e6b Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 12 Jul 2020 12:14:16 +0200 Subject: [PATCH] nixos/systemd: add missing defaults, make options nullable Otherwise evaluation will fail if these are not set. --- nixos/modules/system/boot/systemd.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 020cf38ea3f5..01ecf1d0292b 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} ''}