I also use Wayland on NixOS, had the same issue, and I fixed this on my system by adding to my system configuration.nix:
environment.systemPackages = [ pkgs.sdl3.lib ];
then adding this environment variable to Minecraft (also using Prism Launcher):
LD_PRELOAD=/run/current-system/sw/lib/libSDL3.so
I also use Wayland on NixOS, had the same issue, and I fixed this on my system by adding to my system configuration.nix:
then adding this environment variable to Minecraft (also using Prism Launcher):