nixos/systemd: add missing defaults, make options nullable

Otherwise evaluation will fail if these are not set.
This commit is contained in:
Florian Klink 2020-07-12 12:14:16 +02:00
parent a2e8547c36
commit 3b2b3f7c53

View File

@ -819,7 +819,8 @@ in
}; };
systemd.watchdog.device = mkOption { systemd.watchdog.device = mkOption {
type = types.path; type = types.nullOr types.path;
default = null;
example = "/dev/watchdog"; example = "/dev/watchdog";
description = '' description = ''
The path to a hardware watchdog device which will be managed by systemd. The path to a hardware watchdog device which will be managed by systemd.
@ -828,7 +829,8 @@ in
}; };
systemd.watchdog.runtimeTime = mkOption { systemd.watchdog.runtimeTime = mkOption {
type = types.str; type = types.nullOr types.str;
default = null;
example = "30s"; example = "30s";
description = '' description = ''
The amount of time which can elapse before a watchdog hardware device The amount of time which can elapse before a watchdog hardware device
@ -838,7 +840,8 @@ in
}; };
systemd.watchdog.rebootTime = mkOption { systemd.watchdog.rebootTime = mkOption {
type = types.str; type = types.nullOr types.str;
default = null;
example = "10m"; example = "10m";
description = '' description = ''
The amount of time which can elapse after a reboot has been triggered The amount of time which can elapse after a reboot has been triggered
@ -848,7 +851,8 @@ in
}; };
systemd.watchdog.kexecTime = mkOption { systemd.watchdog.kexecTime = mkOption {
type = types.str; type = types.nullOr types.str;
default = null;
example = "10m"; example = "10m";
description = '' description = ''
The amount of time which can elapse when kexec is being executed before The amount of time which can elapse when kexec is being executed before
@ -928,16 +932,16 @@ in
DefaultIPAccounting=yes DefaultIPAccounting=yes
''} ''}
DefaultLimitCORE=infinity DefaultLimitCORE=infinity
${optionalString (config.systemd.watchdog.device != "") '' ${optionalString (config.systemd.watchdog.device != null) ''
WatchdogDevice=${config.systemd.watchdog.device} WatchdogDevice=${config.systemd.watchdog.device}
''} ''}
${optionalString (config.systemd.watchdog.runtimeTime != "") '' ${optionalString (config.systemd.watchdog.runtimeTime != null) ''
RuntimeWatchdogSec=${config.systemd.watchdog.runtimeTime} RuntimeWatchdogSec=${config.systemd.watchdog.runtimeTime}
''} ''}
${optionalString (config.systemd.watchdog.rebootTime != "") '' ${optionalString (config.systemd.watchdog.rebootTime != null) ''
RebootWatchdogSec=${config.systemd.watchdog.rebootTime} RebootWatchdogSec=${config.systemd.watchdog.rebootTime}
''} ''}
${optionalString (config.systemd.watchdog.kexecTime != "") '' ${optionalString (config.systemd.watchdog.kexecTime != null) ''
KExecWatchdogSec=${config.systemd.watchdog.kexecTime} KExecWatchdogSec=${config.systemd.watchdog.kexecTime}
''} ''}