Did you know?
On NixOS 26.11, systemd-boot can fall back from a generation that fails to boot.
Enable boot.loader.systemd-boot.bootCounting so a bad generation is marked failed and the previous one boots.
- System & services
- Applies to NixOS 26.11 and later
- Last checked
Explained
NixOS 26.11 adds support for systemd’s Automatic Boot Assessment to the systemd-boot loader. With boot counting enabled, each new generation gets a limited number of boot attempts. If the system keeps failing to reach a healthy state, systemd-boot marks that entry as bad and boots the previous generation instead, so a broken kernel or service change does not leave a remote machine stuck.
Turn it on with the new boot.loader.systemd-boot.bootCounting options in configuration.nix, then run sudo nixos-rebuild switch. One side effect to know about: boot entries on the ESP are now named nixos-<content-hash>.conf instead of nixos-generation-<n>.conf. Existing entries are renamed automatically on the next nixos-rebuild boot or switch, so update any scripts that look for the old file names.
You can still roll back by hand at any time with sudo nixos-rebuild switch --rollback, or by picking an older generation in the boot menu.
Learn more
- NixOS 26.11 “Zokor” Released with GNOME 51, KDE Plasma 6.8, and Linux 7.3 Full guide · Updated Nov 2026
