Options to install and configure memtest86plus seem inconsistent and broken

boot.loader.grub.memtest86.enable = true; creates this entry in grub.cfg:

menuentry "Memtest86+" {
  linux ($drive1)/boot/memtest.bin 
}

But what is the proper way of getting memtest.bin into that location?
The docs actually provide an example of installing memtest.bin using extraFiles like I have below, but that puts it in /boot/efi/memtest.bin, not /boot/memtest.bin
Is this a bug, or am I missing something? Does boot.loader.grub.memtest86.enable need to be fixed to use linux ($drive1)/boot/efi/memtest.bin?

  boot.loader.grub = {
    enable = true;
    extraEntriesBeforeNixOS = false;
    default = "saved";              # remember last booted entry
    devices = [ "nodev" ];          # wiki says it is ignored with EFI, but we need to set it to some value
    efiSupport = true;
    efiInstallAsRemovable = true;   # helpful for portability?
    useOSProber = true;             # generate grub entry for existing OS (I had Windows on another disk with an MBR bootloader, so before this would work I had to convert that disk to GPT partition table and EFI boot loader, using Microsoft mbr2gpt - see https://answers.microsoft.com/en-us/windows/forum/all/convert-an-existing-windows-10-installation-from/aa8c2de3-460b-4a8c-b30b-641405f800d7) 
    splashImage = null;             # see https://discourse.nixos.org/t/how-to-apply-the-breeze-grub-theme/4341/6
    #theme = "${pkgs.kdePackages.breeze-grub}/grub/themes/breeze"; # not good
    memtest86.enable = true; # package needs to be installed separately
    extraFiles = { "memtest.bin" = "${pkgs.memtest86plus}/memtest.bin"; };
    extraEntries = ''
      menuentry "Reboot" --class reboot {
        reboot
      }
      menuentry "Reboot to UEFI setup (~Bios)"  --class bios {
        fwsetup
      }
      menuentry "Poweroff" --class shutdown {
        halt
      }
    '';

Thanks.

Ah, I also have boot.loader.efi.efiSysMountPoint = "/boot/efi";, so it seems that is causing the mixup.
Trying to change it to /boot causes other problems though.
If I leave /boot/efi mounted:

/nix/store/4spmk51bavzfyh7s9rz0vv0kv8lq7jdc-grub-2.12/sbin/grub-install: error: /boot doesn't look like an EFI partition.
/nix/store/qw78m8w2cid0c1kf2l47kryvh1m9w18k-install-grub.pl: installation of GRUB EFI into /boot failed: Inappropriate ioctl for device
Failed to install bootloader

If I unmount it and remount to /boot first:

> Adding configuration to bootloader
updating GRUB 2 menu...
cannot copy /nix/store/xlp1f8xyz69q5dc4yc6qgblf74kwvdb3-initrd-linux-6.6.58/initrd to /boot/kernels/xlp1f8xyz69q5dc4yc6qgblf74kwvdb3-initrd-linux-6.6.58-initrd.tmp: No space left on device
Failed to install bootloader

The implementation of that option is quite short:

config = mkIf cfg.enable {
  boot.loader.grub.extraEntries = ''
    menuentry "Memtest86+" {
      linux @bootRoot@/memtest.bin ${toString cfg.params}
    }
  '';
  boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin";
};

(cfg is config.boot.loader.grub.memtest86, and memtest86 is pkgs.memtest86plus.)

So it seems like it should be putting memtest.bin somewhere already, without you needing to touch boot.loader.grub.extraFiles, fwiw. (Whether that location is correct, I don’t know.)