I installed Fedora Silverblue to try the new version on my system with NixOS. SB doesn’t play well with pre-existing efi directories, and in the process, I reformatted the efi partion and the boot entries associated with NixOS are gone. Running grub2-mkconfig from SB does not find the NixOS images unfortunately.
I’m not very handy with grub, and am looking for some advice. I guess I could do a fresh NixOS install and rebuild with my configs, but it seems there should be a better way. I’d appreciate some advice.
There’s nothing to find, you wiped the ESP. Just boot the NixOS ISO, mount up your file systems, and run nixos-install. The cool thing about nixos-install is that it’s idempotent; you can run it on an already installed system and all it’ll do is make sure it’s installed correctly.
Also, NixOS generally wants to be the one in charge of the boot loader, because one of its hallmark features is being able to roll back to any generation in the boot menu.
Silverblue is also particular about controlling efi (it cannot even be installed using a pre-existing efi, though Fed Workstation can). So my question is, should I perform the above procedure using a separate efi partition or the same as SB? Will I be able to boot SB from the NixOS efi partition? I am asking the same thing in the Fedora channels, along with some other questions about booting oddities.
Also, could I perform the above procedure by chrooting from my running OS?
I’m very surprised switch worked in nixos-enter. It really ought to fail, as it tries to do a bunch of starting / stopping / restarting of systemd units which of course aren’t a thing in the chroot.
But nixos-rebuild boot --install-bootloader is expected to work (even though the log output of the command is confusing)