Skip to content

Commit 43f885c

Browse files
committed
feat: add documentation
1 parent 249e777 commit 43f885c

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: rust
3+
description: A reference page for the rust resource
4+
---
5+
6+
The rust resource installs [Rust](https://www.rust-lang.org/) via [rustup](https://rustup.rs/), the official Rust toolchain installer. It also manages global CLI tools installed through `cargo install`. Supported on macOS and Linux.
7+
8+
## Parameters:
9+
10+
- **cargoPackages**: *(array[string])* Global CLI tools to install via `cargo install`. Use the `name@version` syntax 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).
11+
12+
## Example usage:
13+
14+
### Install Rust with common CLI tools
15+
16+
```json title="codify.jsonc"
17+
[
18+
{
19+
"type": "rust",
20+
"cargoPackages": ["ripgrep", "bat", "fd-find"]
21+
}
22+
]
23+
```
24+
25+
### Install Rust with pinned package versions
26+
27+
```json title="codify.jsonc"
28+
[
29+
{
30+
"type": "rust",
31+
"cargoPackages": ["ripgrep@14.1.0", "bat@0.24.0"]
32+
}
33+
]
34+
```
35+
36+
### Install Rust without any additional packages
37+
38+
```json title="codify.jsonc"
39+
[
40+
{
41+
"type": "rust"
42+
}
43+
]
44+
```
45+
46+
## Notes:
47+
48+
- On macOS, Xcode Command Line Tools must be installed before applying the rust resource. The [xcode-tools](/docs/resources/xcode-tools) resource can install them, and is added as a dependency automatically.
49+
- Rust is installed via the official `rustup` script (`https://sh.rustup.rs`). This adds `~/.cargo/bin` to your `PATH` in your shell RC file. Open a new terminal after applying to pick up the updated `PATH`.
50+
- To uninstall Rust and the toolchain, remove the rust resource from your config and run `codify apply`. This runs `rustup self uninstall`.
51+
- Package versions in `cargoPackages` must match a published version on [crates.io](https://crates.io). To find available versions, run `cargo search <name>` or visit the crate's page on crates.io.
52+
- Omitting `@version` for a package always tracks the latest release. Adding `@version` pins the exact version and will reinstall if the pin changes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "1.6.0",
3+
"version": "1.7.0-beta.1",
44
"description": "Default plugin for Codify - provides 50+ declarative resources for managing development tools and system configuration across macOS and Linux",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)