Maintain a symlink to the rust toolchain in the project root

This helps with IntelliJ's setup, rather than finding the toolchain in
the Nix store.
This commit is contained in:
Marc Plano-Lesay 2025-05-02 16:14:56 +10:00
parent 3275f4890d
commit 25cece279e
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
.direnv/
.idea/
/target
.rust-toolchain
*.act
*.bmp
*.jpg

View file

@ -47,6 +47,17 @@
darwin.apple_sdk.frameworks.SystemConfiguration
];
RUST_BACKTRACE = 1;
# Copy rust-toolchain to project directory for easy use in IntelliJ
shellHook = ''
if [ -L ./.rust-toolchain ] && [ "$(readlink ./.rust-toolchain)" = "${rust-toolchain}" ]; then
echo "Rust toolchain symlink is already correct."
else
rm -f ./.rust-toolchain
ln -s ${rust-toolchain} ./.rust-toolchain
echo "Rust toolchain symlink updated."
fi
'';
};
});
}