Dynamic grub boot order

Hi, I have searched online for the ability to change the boot order of my dual boot (NixOS, windows 11) laptop. Very soon I realized two things.

1). I have no idea how to implement any of these solutions into NixOS.

2). This wasn’t what I really wanted.

I thought about it and I realized what I need is a dynamic grub boot order where if I choose to boot into windows, it will make windows the first boot option. And the same for NixOS.

I haven’t tried anything yet because up until two days ago I didn’t even know how to switch from systemd boot to grub boot. Anyone willing to help?

boot.loader.grub.default = “saved”;
boot.loader.grub.extraEntries = “GRUB_SAVEDEFAULT=true”;

1 Like