2026-08-10 23:58:00 +08:00
|
|
|
# treefmt-nix module: wires up `nix fmt` and the `formatting` check.
|
|
|
|
|
_: {
|
|
|
|
|
perSystem = _: {
|
|
|
|
|
treefmt = {
|
|
|
|
|
projectRootFile = "flake.nix";
|
|
|
|
|
|
2026-08-11 01:06:58 +08:00
|
|
|
# Edition must match Cargo.toml's `edition = "2024"` — otherwise
|
|
|
|
|
# treefmt's rustfmt (from nixpkgs) and `cargo fmt`'s rustfmt (from the
|
|
|
|
|
# fenix toolchain, which reads the edition from Cargo.toml) disagree
|
|
|
|
|
# on import ordering/grouping and fight each other.
|
2026-08-10 23:58:00 +08:00
|
|
|
programs.rustfmt.enable = true;
|
2026-08-11 01:06:58 +08:00
|
|
|
programs.rustfmt.edition = "2024";
|
2026-08-10 23:58:00 +08:00
|
|
|
programs.nixfmt.enable = true;
|
|
|
|
|
programs.deadnix.enable = true;
|
|
|
|
|
programs.statix.enable = true;
|
|
|
|
|
programs.taplo.enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|