I dualboot NixOS and Arch. Arch is installed on a btrfs partition with subvolumes. Grub with the default os-prober does detect Arch but it gets the path wrong ignoring the subvolume (/boot instead of /@/boot).
After some research I found os-prober-btrfs for Arch which fixes the problem. But I’m a noob and have no idea how to package it for Nix. How do I do it? Or maybe there’s another way of solving this problem?
The link you gave looks like a fork of os-prober with a compatible CLI, so making an overlay that replaces os-prober by os-prober.overrideAttrs { src = /* the fork * /; } might work.
But before you attempt this, is switching to uefi boot and systemd-boot possible ? then Arch and NixOS won’t fight for boot entries.