From 7ae621916392220aae4dac69198e0743cccef19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlys=20Bras=20de=20fer?= Date: Mon, 5 Aug 2024 08:48:54 +0000 Subject: [PATCH] nixos/systemd-boot: fix infinite timeout --- .../system/boot/loader/systemd-boot/systemd-boot-builder.py | 3 +-- nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py index 87ea569bdb74..2b0381c3eb04 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py @@ -181,8 +181,7 @@ def system_dir(profile: str | None, generation: int, specialisation: str | None) def write_loader_conf(profile: str | None) -> None: with open(f"{EFI_SYS_MOUNT_POINT}/loader/loader.conf.tmp", 'w') as f: - if TIMEOUT != "": - f.write(f"timeout {TIMEOUT}\n") + f.write(f"timeout {TIMEOUT}\n") if profile: f.write("default nixos-%s-generation-*\n" % profile) else: diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix index b1b2b02e6d04..70d68c2e2f43 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -36,7 +36,7 @@ let nix = config.nix.package.out; - timeout = optionalString (config.boot.loader.timeout != null) config.boot.loader.timeout; + timeout = if config.boot.loader.timeout == null then "menu-force" else config.boot.loader.timeout; configurationLimit = if cfg.configurationLimit == null then 0 else cfg.configurationLimit;