feat: rust-cli template (clap/color-eyre/tracing/tokio CLI, crane build with dep caching) #4

Merged
jingus merged 1 commit from t3code/ddf43383 into main 2026-10-20 15:03:09 -05:00
Owner

Adds a rust-cli starter: a cargo CLI with clap (derive), color-eyre, tracing/tracing-subscriber, and tokio.

  • crane nix build: deps compile once (buildDepsOnly), source edits rebuild only the crate; cleanCargoSource keeps README/CI/nix edits out of the cargo cache
  • optimized release profile (thin LTO, single codegen unit, stripped symbols)
  • checks as cached derivations: clippy (-D warnings), fmt, tests, binary smoke
  • apps.validate: Cargo.lock freshness (cargo metadata --locked), dependency sync (cargo fetch --locked), fmt gate, entry-point smoke
  • forgejo CI (runs-on: nix): attic-cache + nix build .#cli + nix flake check + nix run .#validate
  • registered in nix-modules/templates.nix, root README updated, both lockfiles committed

Verified locally: nix flake check and nix run .#validate green on a copy in /tmp and on a fresh nix flake init -t path:...#rust-cli instantiation.

Adds a `rust-cli` starter: a cargo CLI with clap (derive), color-eyre, tracing/tracing-subscriber, and tokio. - crane nix build: deps compile once (`buildDepsOnly`), source edits rebuild only the crate; `cleanCargoSource` keeps README/CI/nix edits out of the cargo cache - optimized release profile (thin LTO, single codegen unit, stripped symbols) - checks as cached derivations: clippy (`-D warnings`), fmt, tests, binary smoke - `apps.validate`: Cargo.lock freshness (`cargo metadata --locked`), dependency sync (`cargo fetch --locked`), fmt gate, entry-point smoke - forgejo CI (`runs-on: nix`): attic-cache + `nix build .#cli` + `nix flake check` + `nix run .#validate` - registered in `nix-modules/templates.nix`, root README updated, both lockfiles committed Verified locally: `nix flake check` and `nix run .#validate` green on a copy in /tmp and on a fresh `nix flake init -t path:...#rust-cli` instantiation.
feat: rust-cli template (clap/color-eyre/tracing/tokio CLI, crane build with dep caching)
Some checks failed
ci / flake-check (push) Successful in 17s
ci / flake-check (pull_request) Successful in 15s
ci / templates (push) Failing after 1m0s
ci / templates (pull_request) Failing after 58s
af326ff4ed
jingus merged commit ae3b135057 into main 2026-10-20 15:03:09 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jingus/starters!4
No description provided.