diff --git a/lib/rust/mkAttrs.nix b/lib/rust/mkAttrs.nix index 1f8c535d..4d8d9f69 100644 --- a/lib/rust/mkAttrs.nix +++ b/lib/rust/mkAttrs.nix @@ -296,6 +296,13 @@ with self.lib.rust.targets; CARGO_BUILD_TARGET = target; } + // optionalAttrs pkgsCross.stdenv.hostPlatform.isLinux { + nativeBuildInputs = [ + final.mold + ]; + + RUSTFLAGS = "-Clink-arg=-fuse-ld=mold"; + } // optionalAttrs (final.stdenv.buildPlatform.config != pkgsCross.stdenv.hostPlatform.config) ( { strictDeps = true;