If you have ever experienced a primary bootloader failure it would be helpful to have an alternative such as Open Core.
Nixos booting via systemd as default is recognized by Open Core via ESP loader–>entries/*.conf configuration.
If instead, you normally boot nixos via Grub2 it is possible, using an appropriate Open Core scan policy and required *.efi linux filesystem boot drivers “ext4_x64.efi” and “ OpenLinuxBoot.efi”, to detect and boot both default and custom kernels via Open Core. It is easy to customize boot entries via ESP loader–>entries. A custom kernel may be generated independently from Nixos.
For example, a custom kernel based upon the recently released 7.0 linux kernel.
Create, for example, a directory within the root file system of the ESP and name it “custom”.
Copy your custom kernel and initrd into the “custom” directory.
Within the ESP root file system find or create directory “loader” and subdirectory “entries”.
Within “entries” create a text file named, for example, “ Nixos-custom_kernel.conf”.
Configure the .conf file, for example:
title Nixos custom kernel
linux /custom/vmlinuz-7.0.0-rc1
initrd /custom/initrd.img-7.0.0-rc1
options root=UUID=your_nixos_UUID init=/nix/var/nix/profiles/system/init loglevel=4 lsm=landlock,yama,bpf
“your_nixos_UUID” means the UUID of your nixos GPT partition.
Verify accuracy of configuration and save.
Boot your computer to manually select the bootloader, and choose Open Core to display configured nixos boot entry/entries.
Keep in mind that it is beyond the scope of this posting to include instructions to prepare the config.plist for Open Core. If properly configured, Open Core can detect and boot GPT partitions for Windows and Linux filesystems such as ext2 and ext4, although the ext4 driver has file system feature detection limitations which can be bypassed via the ESP loader–>entries *.conf configuration.