I know it’s not a default, but `buildFHSUserEnv` is probably what you would have been interested in.
And also `programs.nix-ld` now, that allow you to impurely include libraries available to all programs. It does some LD_LIBRARY_PATH hacks, but AFAIK it worked well enough for me when I had this in my system (I don't anymore since I barely run dynamically linked executable from other sources).
This worked OOTB:
curl -L -O https://github.com/sandreas/tone/releases/download/v0.2.4/tone-0.2.4-linux-arm64.tar.gz
tar xzf tone-0.2.4-linux-arm64.tar.gz
nix run github:thiagokokada/nix-alien -- ./tone-0.2.4-linux-arm64/tone --help
Which is nice because:a) I didn't know about tone
b) I am in the process of sorting out some tagging of my personal music so tone looks like exactly what I need and will come in super handy
So, thanks!