I’m in the process of reinstalling my virtual machines as bare-metal installs, using EndeavourOS as the initial distro with systemd-boot. I’ve added Debian, Fedora, and openSUSE to the existing bootloader, but I’ll be damned if I can find any documentation that describes how to add NixOS. While there are some tutorials on installing NixOS last w/systemd-boot then letting it control everything exist, that’s not an option for me.
So far, the closest I’ve gotten is installing NixOS with GRUB, then chainloading via systemd-boot. But that’s not working (can’t find the NixOS root partition, don’t really want this setup anyways). Since I can’t find kernel-install, that option is also out.
If anyone can show me how the systemd-boot configuration entries are created, I’d much appreciate it.
Why not? It’s easy enough to configure systemd-boot with NixOS. And NixOS really wants to be able to create its own boot entries in order to offer its hallmark feature of putting generations in the boot menu.
Unfortunately NixOS doesn’t really have a way of populating boot entries without controlling the boot loader. I think it would be a pretty simple change to our systemd-boot module to support only managing NixOS’s systemd-boot style entries and files without actually managing systemd-bootx64.efi / BOOTX64.EFI itself.
Yeah, I see what you mean. The systemd version in NixOS is very new, so that would not be an issue for my Arch-based systems. In this use-case, I would prefer that Nix take over handling the bootloader 100%.
Especially since bootctl (the tool used to install / update systemd-boot on the ESP) checks the version number of the systemd-boot that’s already present to make sure it’s not doing a downgrade.
Don’t delete it, it will just be recreated on update. Instead override it. Something like sudo ln -s /dev/null /etc/pacman.d/hooks/systemd-boot.hook or just place a 0 byte file at that location.