From c8b1032cc4ea485c87c31cc09cb6dc662b999764 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Mon, 5 Dec 2022 11:46:59 -0700 Subject: [PATCH] nixos/installer/cd-dvd/iso-image: Honor boot.loader.timeout for EFI EFI boot timeout is currently a static 10 whereas syslinux uses boot.loader.timeout. This changes the EFI config to match. Some discussion at https://discourse.nixos.org/t/how-to-override-let-variables/23741/2 (cherry picked from commit 7e1a3e4a8f6cf85cd39d460222e52fe041a95c1c) --- nixos/modules/installer/cd-dvd/iso-image.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index e37142f05f41..f6aae9e3f410 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -79,6 +79,14 @@ let max = x: y: if x > y then x else y; + # Timeout in grub is in seconds. + # null means max timeout (infinity) + # 0 means disable timeout + grubEfiTimeout = if config.boot.loader.timeout == null then + -1 + else + config.boot.loader.timeout; + # The configuration file for syslinux. # Notes on syslinux configuration and UNetbootin compatiblity: @@ -286,7 +294,7 @@ let if serial; then set with_serial=yes ;fi export with_serial clear - set timeout=10 + set timeout=${toString grubEfiTimeout} # This message will only be viewable when "gfxterm" is not used. echo ""