NixOS booted-system frozen after I migrated to flakes

I have migrated my configuration.nix to flakes using this guide.
Everything seems to work fine when I do
sudo nixos-rebuild switch --flake .
However when I reboot, my system is stuck at the configuration before the migration. /run/booted-system never changes. I can switch again, use the new packages but after reboot the old config is applied.

How can I debug the issue?

nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.5.13, NixOS, 23.11 (Tapir), 23.11.2391.9dd7699928e2`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
1 Like

Hey welcome to NixOS discourse! :slight_smile:

However when I reboot, my system is stuck at the configuration before the migration.

So the new system configuration does not appear in the bootloader?

Thanks :wink:
No, the last one in Grub menu is 175.
nixos-rebuild list-generations --flake '.' | cat says the current one is 193. I don’t even have 175 listed there.

That sounds like there are more than just one generation of configurations missing. I mean you could try reinstall the bootloader and see if that changes anything.

sudo nixos-rebuild --install-bootloader switch --flake .

2 Likes

Thanks again, now for the pointer to the bootloader. Turns out I was doing two things at once and blamed flakes wrongly.
I have two UEFI partitions, because every time I upgrade the BIOS, the tool messes with the UEFI partition, leaving just Windows working. Long story short, the tool activated the other partition :person_facepalming: . Updating my /boot mount point fixed the issue. (I did not have to use --install-bootloader, but had to run nixos-rebuild twice, probably it first writes to grub.cfg and then remounts the partitions).

1 Like

Awesome, great to hear that you got this fixed!