maint: Move treefmt to dev partition

Moves treefmt-nix input and configuration from the main flake to the
dev partition, since it's a development-only dependency. Also switches
pre-commit hooks from individual formatter hooks to the unified treefmt
hook for better consistency.
This commit is contained in:
Robert Hensing 2025-12-06 12:04:26 +01:00
parent cfda626614
commit 4a1889fb0c
5 changed files with 24 additions and 105 deletions

View file

@ -6,6 +6,7 @@
imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
];
perSystem =
{
@ -17,7 +18,20 @@
{
nix-bindings-rust.nixPackage = inputs'.nix.packages.default;
pre-commit.settings.hooks.nixfmt-rfc-style.enable = true;
treefmt = {
# Used to find the project root
projectRootFile = "flake.lock";
programs.rustfmt = {
enable = true;
edition = "2021";
};
programs.nixfmt.enable = true;
programs.deadnix.enable = true;
#programs.clang-format.enable = true;
};
pre-commit.settings.hooks.treefmt.enable = true;
# Temporarily disable rustfmt due to configuration issues
# pre-commit.settings.hooks.rustfmt.enable = true;
pre-commit.settings.settings.rust.cargoManifestPath = "./Cargo.toml";