| title | rust |
|---|---|
| description | 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.
- 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).
[
{
"type": "rust",
"cargoPackages": ["ripgrep", "bat", "fd-find"]
}
][
{
"type": "rust",
"cargoPackages": ["ripgrep@14.1.0", "bat@0.24.0"]
}
][
{
"type": "rust"
}
]- 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.