Skip to content

Commit d42d6e6

Browse files
committed
fix: Symlink rustfmt instead of copying
1 parent 2cca51f commit d42d6e6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

nix/rust/toolchain.nix

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ importingFlake: {
2626
toolchain: toolchain.default.override { extensions = [ "rustfmt" ]; }
2727
);
2828

29-
# We want *only* the rustfmt binaries. This trick doesn't
30-
# really work for other components of the rust toolchain,
31-
# but specifically rustfmt is quite self-contained.
29+
# Symlink so rustfmt keeps working on aarch64-darwin, where
30+
# it's dynamically linked against the toolchain's lib/.
3231
rustfmtNightly = pkgs.runCommand rustfmtToolchain.name { } ''
3332
mkdir -p $out/bin
34-
cp ${rustfmtToolchain}/bin/{cargo-fmt,rustfmt} $out/bin
33+
ln -s ${rustfmtToolchain}/bin/{cargo-fmt,rustfmt} $out/bin
3534
'';
3635
in
3736
[

0 commit comments

Comments
 (0)