Grub dual boot error

Hey, I’m trying to dual boot and I’m having issues getting grub to work properly

updating GRUB 2 menu...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
lsblk: /dev/mapper/no*[0-9]: not a block device
lsblk: /dev/mapper/raid*[0-9]: not a block device
lsblk: /dev/mapper/disks*[0-9]: not a block device
Found Windows Boot Manager on /dev/sda1@/efi/Microsoft/Boot/bootmgfw.efi
installing the GRUB 2 boot loader on /dev/sda ...
Installing for i386-pc platform.
/nix/store/2d55x0liscvba4isa4shfff48py5c3bx-grub-2.12/sbin/grub-install: error: cannot find a GRUB drive for /dev/sda .  Check your device.map.
/nix/store/nimksw3aan1md9djl78vz7nbgfa5cmdr-install-grub.pl: installation of GRUB on /dev/sda  failed: Inappropriate ioctl for device
warning: error(s) occurred while switching to the new configuration

This is my code I have, I’ve tried pointing it to a parition and a device and neither seem to make it work. I’m trying to dual boot windows aswell.

  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "/dev/sda ";
  boot.loader.grub.useOSProber = true;
  boot.loader.grub.efiSupport = true;

I got it to build with the following, but one reboot later shows it doesn’t show up with grub after I commented out systemd boot.

  boot.supportedFilesystems = [ "ntfs" ];

  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "nodev";
  boot.loader.grub.useOSProber = true;
  boot.loader.grub.efiSupport = true;

The grub device should probably be a partition, such as /dev/sda1. Or use more clever paths. In any case, be careful with your data. Here’s mine:

I got it working with systemd, the true problem was I had three boot options for linux.

  1. uefi os m_2
  2. Windows Boot Loader
  3. Nixos boot
  4. Linux Boot Loader

When I selected the 4th option Windows just showed up, I didn’t have to add anything to my config.