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
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# treefmt-nix module: wires up `nix fmt` and the `formatting` check.
|
||||
_: {
|
||||
perSystem = _: {
|
||||
treefmt = {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs.rustfmt.enable = true;
|
||||
programs.nixfmt.enable = true;
|
||||
programs.deadnix.enable = true;
|
||||
programs.statix.enable = true;
|
||||
programs.taplo.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user