Skip to content

Commit f9264bb

Browse files
karaolidisnzbr
authored andcommitted
feat(wsl-conf): add boot.initTimeout option (#1078)
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
1 parent 364422f commit f9264bb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

modules/wsl-conf.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ with lib; {
6363
default = true;
6464
description = "Use systemd as init. Disabling this may break your NixOS installation";
6565
};
66+
initTimeout = mkOption {
67+
type = types.nullOr types.ints.unsigned;
68+
default = null;
69+
description = ''
70+
Time in milliseconds that WSL waits for the init process to become
71+
ready when starting the distribution, and for `systemctl poweroff` to
72+
finish when the distribution is terminated. When `null`, WSL's built-in
73+
default of 10000 is used.
74+
'';
75+
};
6676
};
6777
interop = {
6878
enabled = mkOption {
@@ -108,7 +118,7 @@ with lib; {
108118
config = mkIf config.wsl.enable {
109119

110120
environment.etc."wsl.conf".text = generators.toINI { } (
111-
lib.filterAttrsRecursive (_: v: v != "") config.wsl.wslConf
121+
lib.filterAttrsRecursive (_: v: v != null && v != "") config.wsl.wslConf
112122
);
113123

114124
warnings = optional (!config.wsl.wslConf.boot.systemd)

0 commit comments

Comments
 (0)