Nixos-rebuild does not update Grub generation list

Context: #nixos on 2020-11-27 — irc logs; to #nixos on 2020-11-27 — irc logs;

I’ve been using NixOS quite stably for the last 2 years, however around 20 generations ago, nixos-rebuild would no longer update the grub generation list and let me switch at boot time, so I’ve been stuck on generation 83. This was apparent when I wanted to switch window managers from i3 to sway, and nothing happened despite a rebuild.

1 Like

I have the exact same problem. When I try to add a shell alias or environment variable, nothing changes on the new generation, despite trying to explicitely delete the fish.conf in the /etc/fish/ directory. It still loads my old config, and I don’t even know where it takes it since I deleted all previous generations through nix-collect-garbage -d

I just realized that if I boot from the other EFI boot, then it catches the right generation of nixOS. For the moment I’ll stick to that (I’ll change the default boot loader).

Usually this happens when /boot is not mounted as you expect.

If the “wrong” /boot is in place, then NixOS will generate the new boot loader config and install it to the wrong place. This can happen if you have multiple ESPs and mount the wrong one, or, if you simply messed up your /boot mount and the writes are just falling through to / which isn’t being considered by the bootloader.

I just realized that if I boot from the other EFI boot, then it catches the right generation of nixOS. For the moment I’ll stick to that (I’ll change the default boot loader).

@philipGaudreau, Yeah, it sounds like maybe you have multiple EFI boot entries and one is old. If you switched from GRUB->systemd-boot and then your system kept loading GRUB… you would find yourself in this situation.

I’ve been using NixOS quite stably for the last 2 years, however around 20 generations ago, nixos-rebuild would no longer update the grub generation list and let me switch at boot time, so I’ve been stuck on generation 83. This was apparent when I wanted to switch window managers from i3 to sway, and nothing happened despite a rebuild.

Similar thing @siraben - I think we chatted a few days ago and you’d had something change as a result of changing bootloaders. Is it possible this issue was introduced around then?

Yes. I’m pretty sure that changing bootloaders caused the generation list to stop updating.