This works fine as long as I’m building pure Rust projects. When I tried to build something that needed libpq, compilation failed saying libpq.so.5 not found.
The issue goes away if I remove the cargo/config.toml.
Apparently we do have a wrapped lld now, but it’s not in pkgs.lld, it’s in pks.llvmPackages.bintools.
Let me restate the solution more clearly:
There are two packages that provide LLD in nixpkgs: pkgs.lld and pkgs.llvmPackages.bintools . The former is unwrapped, and doesn’t, eg, set rpath. The latter is wrapped, and just works. So, the following fixed the issue I was having with compiling Rust code: