Recently, after I've done something to my multiboot system, when I boot NixOS with systemd-boot
, boot menu does not show up anymore even though the timeout is still set to 2 seconds in /loader/loader.conf
(on the ESP):
# /loader/loader.conf on the ESP
timeout 2
default nixos-generation-380
Here is what I have in my /etc/nixos/configuration.nix
:
{ # ...
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
timeout = 2;
};
}
It turned out that to see the boot menu, I had to press down some key during start-up, as if the timeout had been set to 0 (instead of 2) seconds.
I tried removing systemd-bootx64.efi
from the ESP and re-installing NixOS with nixos-install
from a USB flash drive. This restored systemd-bootx64.efi
but did not bring back the boot menu.
It seems that this problem is not completely uncommon:
Arch Linux Forums: systemd-boot, no timeout, no select menu - LoaderEntryDefault
Both issues are reported to be solved. However, I did not understand the first solution:
Edit 3: SOLVED! Reinstalling the UEFI did the trick.
What does it mean to "reinstall the UEFI"?
As to the second, it suggests to use t and Shift+t keys in the boot menu (which shows up if some key is pressed down during the start-up) to set a different timeout, but I do not want just a different timeout, I want systemd-boot
to respect the settings in /loader/loader.conf
.
So, my question was: how to make systemd-boot
use again the settings from /loader/loader.conf
?
I am editing this question after I've found the solution, and I am going to post my answer now.