diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix index 1ff36e71e82babd..e8c1edf7d8b256f 100644 --- a/pkgs/development/compilers/rust/rustfmt.nix +++ b/pkgs/development/compilers/rust/rustfmt.nix @@ -15,6 +15,11 @@ rustPlatform.buildRustPackage rec { rustPlatform.rust.rustc.llvm ] ++ lib.optional stdenv.isDarwin Security; + preFixup = lib.optionalString stdenv.isDarwin '' + install_name_tool -add_rpath "${rustPlatform.rust.rustc}/lib" "$out/bin/rustfmt" + install_name_tool -add_rpath "${rustPlatform.rust.rustc}/lib" "$out/bin/git-rustfmt" + ''; + # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler RUSTC_BOOTSTRAP = 1;