Make pre-commit re-use the same config for treefmt
All checks were successful
/ test (push) Successful in 1m23s

This commit is contained in:
Andrea Ciceri 2024-11-15 10:06:16 +01:00
parent 827f1d16d9
commit 159e7a7c72
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg

View file

@ -11,19 +11,22 @@
]; ];
perSystem = perSystem =
{ ... }: { config, ... }:
{ {
treefmt.config = { treefmt.config = {
projectRootFile = ".git/config"; projectRootFile = ".git/config";
flakeFormatter = true;
flakeCheck = true;
programs = { programs = {
nixfmt.enable = true; nixfmt.enable = true;
deadnix.enable = false;
}; };
}; };
pre-commit.settings.hooks = { pre-commit.settings = {
nixfmt-rfc-style.enable = true; hooks.treefmt = {
deadnix.enable = false; enable = true;
package = config.treefmt.build.wrapper;
};
}; };
}; };