How to change GRUB’s installation directory from /boot to /efi in NixOS?

Hello I am a beginner at NixOS but not Linux in general. I’m trying to install GRUB on a separate EFI partition mounted at /efi instead of /boot. I want GRUB’s core files and grub.cfg to be installed in /efi.

I passed --boot-directory parameter to boot.loader.grub.extraGrubInstallArgs = [ "--boot-directory=/efi" ]; but it left my system unbootable and I was greeted with grub-rescue

From what I can tell, setting boot.loader.efi.efiSysMountPoint = "/efi"; only changes the --efi-directory, not the --boot-directory, which still defaults to /boot. I looked through the various options, but I did not find anything related to it.

Is there any supported or clean way in NixOS to install GRUB in the /efi directory?

Also, I tried changing the bootloader ID by passing:
boot.loader.grub.extraGrubInstallArgs = [ "--bootloader-id=SOMETHINGSOMETHINGHERE" ];

But it seemed to be ignored, the entry was still created with the default ID NixOS-efi. Is there a proper way to override this too?

Would appreciate any pointers or examples.