Commit Graph

5 Commits

Author SHA1 Message Date
tomatocream d61ba8aec2 Add README.md and make the template workflow explicit in CLAUDE.md
README covers the copy-clone-rename-build flow and the simple cargo/nix
run commands. CLAUDE.md now states the intended workflow up front
(rename script, then build whatever the user actually wants) instead
of only implying it via the rename-script section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ALEXkc7pTro7tF1WcUuKb
2026-08-11 00:28:57 +08:00
tomatocream 6e460aca80 Add CLAUDE.md documenting cargo/nix workflows and architecture
Covers both dev paths (plain cargo vs nix develop/build/flake check),
LSP setup via the fenix toolchain's RUST_SRC_PATH, how nix/rust.nix
is shared between the package build and dev shell, where to add
unit vs integration tests, and how to use the rename script. Includes
a note to keep it updated as the template grows into real functionality.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ALEXkc7pTro7tF1WcUuKb
2026-08-11 00:22:30 +08:00
tomatocream 2583848813 Add integration test example and project rename script
tests/greet.rs shows the tests/ convention alongside the existing
inline unit test in src/lib.rs, so both standard locations are covered.

scripts/rename-project.sh replaces the "rust_template" placeholder
throughout Cargo.toml, flake.nix, nix/rust.nix, src/main.rs,
benches/greet.rs, and tests/greet.rs, then regenerates Cargo.lock.
Verified in a scratch copy: renamed crate builds, tests pass, and the
Nix package builds and runs correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ALEXkc7pTro7tF1WcUuKb
2026-08-11 00:16:55 +08:00
tomatocream 840cea1f10 Add Nix flake: crane + fenix build, treefmt-nix formatting
Uses flake-parts to organize outputs, with nix/rust.nix defining a
single craneLib/toolchain/commonArgs environment shared by the package
build (nix/rust.nix) and the dev shell (nix/devshell.nix), so both stay
close to identical. Deps are cached separately from the crate itself via
crane's buildDepsOnly, giving incremental rebuilds. Checks cover clippy,
rustfmt, cargo-doc, cargo-audit, and nextest; treefmt-nix wires up
`nix fmt` for Rust/Nix/TOML files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ALEXkc7pTro7tF1WcUuKb
2026-08-10 23:58:00 +08:00
tomatocream 979e77571f Add clap CLI, lib crate, unit test, and criterion benchmark
Minimal scaffold before turning this into a Nix flake template.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ALEXkc7pTro7tF1WcUuKb
2026-08-10 23:49:06 +08:00