I tryied to simplement this a while ago Add an option to set GRUB keyboard layout · Issue #41247 · NixOS/nixpkgs · GitHub.
My conclusion at the time was that it probably is technically possible but the required options were not exposed in the high level grub commands nixos builds upon. And even then not every grub input module supported custom layout (only at_keyboard did). I don’t know if the situation changed since then.
In the end I used the dual passphrase hack you mentionned.