The problem here really seems to be with nix. The /nix path shouldn't be hard coded. (Security concerns aside, I don't want a package manager to clutter up my root directory.)
Also, the path isn't really hardcoded. You can use a custom path, but that means you can't use binary caches.
It ought to be possible to use binary caches and still swap out the path. (Modifying a string in an ELF executable isn't that hard.)
As far as I know it creates a new elf each time it is called (it doesn't modify a file on place) so the length of library name is not an issue.