rust
A reference page for the rust resource
The rust resource installs Rust via rustup, the official Rust toolchain installer. It also manages global CLI tools installed through cargo install. Supported on macOS and Linux.
Parameters:
- cargoPackages: (array[string]) Global CLI tools to install via
cargo install. Use thename@versionsyntax to pin a specific version (e.g."ripgrep@14.1.0"). Omitting the version installs the latest release. Codify adds packages that are missing and removes packages that are no longer listed (in stateful mode).
Example usage:
Install Rust with common CLI tools
[
{
"type": "rust",
"cargoPackages": ["ripgrep", "bat", "fd-find"]
}
]Install Rust with pinned package versions
[
{
"type": "rust",
"cargoPackages": ["ripgrep@14.1.0", "bat@0.24.0"]
}
]Install Rust without any additional packages
[
{
"type": "rust"
}
]Notes:
- On macOS, Xcode Command Line Tools must be installed before applying the rust resource. The xcode-tools resource can install them, and is added as a dependency automatically.
- Rust is installed via the official
rustupscript (https://sh.rustup.rs). This adds~/.cargo/binto yourPATHin your shell RC file. Open a new terminal after applying to pick up the updatedPATH. - To uninstall Rust and the toolchain, remove the rust resource from your config and run
codify apply. This runsrustup self uninstall. - Package versions in
cargoPackagesmust match a published version on crates.io. To find available versions, runcargo search <name>or visit the crate's page on crates.io. - Omitting
@versionfor a package always tracks the latest release. Adding@versionpins the exact version and will reinstall if the pin changes.