I think this idea being pursued by Mic92 is pretty cool!
The repository is not there yet and at the moment provides only the ability to set a custom LD_LIBRARY_PATH for non-NixOS binaries; but I explain some mind-blowing opportunities that can be done with nix-index for instance.
https://fzakaria.com/2020/11/17/on-demand-linked-libraries-for-nix.html