This is tracked upstream at https://github.com/libsdl-org/SDL/issues/5889 and should be fixed with SDL2 version 2.24.0. Can you please update the bundled version to at least version 2.24.0? Thanks in advance :-)
In the meantime if others are affected, this can be patched out by replacing the call ...
In my eyes nix has to provide a way to map those paths. Patching a binary sounds so dirty, I could not believe it. On Amiga I knew software, that - if it finds out it was patched - did overwrite sectors on the floppy, instead of reading - just to prevent hackers from replacing the authors name ...
personally, i wouldn't expect wube to change anything to suit NixOS as it deviates so far from what is considered normal/acceptable Linux system practices that this kind of breakage is just something that you should expect.
It's about Nix (the package manager) in general, not just NixOS (the ...
As mentioned in Linux config directory should follow XDG Base Directory Specification , this is a bit more exotic but it helps packaging (note: not distributing) Factorio for Nix and maybe even other distros (IIRC Debian policy would be something like "/usr/share /games /factorio").