Cargo Nix Plugin — Development skill for Claude Code
A Nix plugin that resolves Cargo workspaces natively and allows for crate level builds.
How to install Cargo Nix Plugin
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anthropics/cargo-nix-plugin and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Cargo Nix Plugin does
A Nix plugin that resolves Cargo workspaces natively and allows for crate level builds.
Alternatives in Development
- JEngine — The solution that allows unity games to update in runtime 2.2k ★
- Obsidian Ingest — Ingest a source into the vault — the vault rewrites itself around new knowledge 277 ★
- Agent Skills Nix — Declarative management of Agent Skills on Nix 216 ★
README
cargo-nix-plugin
A Nix plugin that resolves Cargo workspaces natively, replacing the generated `Cargo.nix` file from crate2nix with a single `builtins.resolveCargoWorkspace` primop.
What It Does
- Reads
Cargo.lockand the sparse registry index directly, so there is nocargobinary at eval time (you can also feed it pre-generatedcargo metadataJSON) - Evaluates
cfg()target expressions for your platform during resolution - Produces an attrset that plugs into
buildRustCrate - No more
crate2nix generatestep or checked-in 50K-100K lineCargo.nix
Install
Add the plugin to your Nix configuration:
# nix.conf or via --option — point at the directory so the right
# extension (.so/.dylib) is picked up automatically
plugin-files = /path/to/cargo-nix-plugin/lib/nix/plugins
Or use the flake output:
{
inputs.cargo-nix-plugin.url = "github:anthropics/cargo-nix-plugin";
}
Usage
Default (lockfile resolve)
Point at your workspace root:
cargoNix = cargo-nix-plugin.lib {
inherit pkgs;
src = ./.; # must contain Cargo.toml + Cargo.lock
};
The plugin reads `Cargo.lock` plus the sparse registry index directly — no `cargo` binary, no crate sources at eval time. On first use it fetches each crate's index entry (a few hundred bytes) into `$CARGO_HOME` and reuses it on later runs.
If you already redirect cargo to a mirror (`CARGO_REGISTRIES_CRATES_IO_INDEX` or `[source.crates-io] replace-with` in `.cargo/config.toml`), the resolver picks that up too:
# .cargo/config.toml — used by both cargo and the plugin
[source.crates-io]
replace-with = "mirror"
[source.mirror]
registry = "sparse+https://artifactory.example/api/cargo/crates/index/"
If every index lookup fails (e.g. egress to `index.crates.io` is blocked and no mirror is configured), evaluation fails rather than silently producing derivations with missing features.
Explicit metadata
You can also generate cargo's resolution up front an
Related Skills
Architecture Check
Architecture reviewer step 2 — verify dependency direction, crate boundaries, type placement
Anyagent
A Rust crate to connect multiple harnesses under one, simple, up-to-date interface.
Dj Search
Crate-digging skill for Claude Code: find what's trending over 7/14/30 days, skip what you already own (whole
Mempal
本文件是仓库级 agent 工作约束,内容与 CLAUDE.md 保持一致;在本仓库内工作的 agent 都应遵循以下规则。 Rust 实现的 coding agent 项目记忆工具。单二进制,cargo install
Clippy
Run cargo clippy and fix all warnings and errors iteratively.
Tests
Run tests and fix any failures. Uses cargo nextest run as required by this project.
Related Agents
High Level Advisor
Brutally honest strategic advisor who cuts through comfort and delivers unfiltered truth. Prioritizes ruthless
Gsc Overview
GSC site overview agent. Resolves permission level, lists sitemaps and their error/warning counts, probes the