mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos: loader: added generic config.boot.loader.timeout option
timeout options of grub and gummiboot will inherit the value of this option by default.
This commit is contained in:
parent
db75b5d052
commit
f93ba51469
4 changed files with 20 additions and 2 deletions
|
@ -371,6 +371,7 @@
|
||||||
./system/boot/kernel.nix
|
./system/boot/kernel.nix
|
||||||
./system/boot/kexec.nix
|
./system/boot/kexec.nix
|
||||||
./system/boot/loader/efi.nix
|
./system/boot/loader/efi.nix
|
||||||
|
./system/boot/loader/loader.nix
|
||||||
./system/boot/loader/generations-dir/generations-dir.nix
|
./system/boot/loader/generations-dir/generations-dir.nix
|
||||||
./system/boot/loader/grub/grub.nix
|
./system/boot/loader/grub/grub.nix
|
||||||
./system/boot/loader/grub/ipxe.nix
|
./system/boot/loader/grub/ipxe.nix
|
||||||
|
|
|
@ -196,7 +196,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
timeout = mkOption {
|
timeout = mkOption {
|
||||||
default = 5;
|
default = if (config.boot.loader.timeout != null) then config.boot.loader.timeout else -1;
|
||||||
type = types.int;
|
type = types.int;
|
||||||
description = ''
|
description = ''
|
||||||
Timeout (in seconds) until GRUB boots the default menu item.
|
Timeout (in seconds) until GRUB boots the default menu item.
|
||||||
|
|
|
@ -31,7 +31,9 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
timeout = mkOption {
|
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;
|
example = 4;
|
||||||
|
|
||||||
|
|
15
nixos/modules/system/boot/loader/loader.nix
Normal file
15
nixos/modules/system/boot/loader/loader.nix
Normal file
|
@ -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.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue