diff options
author | Bob van der Linden <bobvanderlinden@gmail.com> | 2015-01-14 20:35:54 +0100 |
---|---|---|
committer | Luca Bruno <lethalman88@gmail.com> | 2015-01-30 09:53:44 +0100 |
commit | f93ba5146954a98a3ba132ebd1cd81f04ba01fe4 (patch) | |
tree | 68d5737dae79a0d861e1254a215f5aba9cab28c0 /nixos/modules/system | |
parent | db75b5d052f67ffdda7232ab032161343e8cca59 (diff) | |
download | nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.tar nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.tar.gz nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.tar.bz2 nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.tar.lz nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.tar.xz nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.tar.zst nixpkgs-f93ba5146954a98a3ba132ebd1cd81f04ba01fe4.zip |
nixos: loader: added generic config.boot.loader.timeout option
timeout options of grub and gummiboot will inherit the value of this option by default.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/loader/grub/grub.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/loader/gummiboot/gummiboot.nix | 4 | ||||
-rw-r--r-- | nixos/modules/system/boot/loader/loader.nix | 15 |
3 files changed, 19 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 3ea00e40c3b..b16a725aba8 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 003f72b37f9..b1ecbb8141f 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 00000000000..28cceafea7c --- /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 |