Skip to content

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.

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

← All tech tips · Suggest a fix

Back to top