diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index cf82e5035d9a..c9b91acde71e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -371,6 +371,7 @@ ./system/boot/kernel.nix ./system/boot/kexec.nix ./system/boot/loader/efi.nix + ./system/boot/loader/loader.nix ./system/boot/loader/generations-dir/generations-dir.nix ./system/boot/loader/grub/grub.nix ./system/boot/loader/grub/ipxe.nix diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 3ea00e40c3b3..b16a725aba8e 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -196,7 +196,7 @@ in }; timeout = mkOption { - default = 5; + default = if (config.boot.loader.timeout != null) then config.boot.loader.timeout else -1; type = types.int; description = '' Timeout (in seconds) until GRUB boots the default menu item. diff --git a/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix b/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix index 003f72b37f9e..b1ecbb8141fc 100644 --- a/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix +++ b/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix @@ -31,7 +31,9 @@ in { }; timeout = mkOption { - default = null; + default = if (config.boot.loader.timeout != null) then + (if (config.boot.loader.timeout == 0) then null else config.boot.loader.timeout) + else config.boot.loader.timeout; example = 4; diff --git a/nixos/modules/system/boot/loader/loader.nix b/nixos/modules/system/boot/loader/loader.nix new file mode 100644 index 000000000000..28cceafea7ca --- /dev/null +++ b/nixos/modules/system/boot/loader/loader.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options = { + boot.loader.timeout = mkOption { + default = 5; + type = types.nullOr types.int; + description = '' + Timeout (in seconds) until loader boots the default menu item. Use null if the loader menu should be displayed indefinitely. + ''; + }; + }; +} \ No newline at end of file