2024-10-28 13:11:40 +00:00
|
|
|
{
|
2024-10-28 13:42:21 +00:00
|
|
|
self,
|
2024-10-28 13:12:06 +00:00
|
|
|
nixpkgs,
|
|
|
|
treefmt-nix,
|
|
|
|
flake-utils,
|
2024-10-28 13:42:21 +00:00
|
|
|
pre-commit-hooks,
|
2024-10-28 13:12:06 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (
|
|
|
|
system: let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
2024-10-28 13:42:21 +00:00
|
|
|
treefmtWrapper = treefmtEval.config.build.wrapper;
|
2024-10-28 13:12:06 +00:00
|
|
|
in {
|
2024-10-28 13:42:21 +00:00
|
|
|
packages.formatter = treefmtWrapper;
|
|
|
|
formatter = self.packages.${system}.formatter;
|
|
|
|
checks.pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
|
|
src = ./.;
|
|
|
|
hooks = {
|
|
|
|
treefmt = {
|
|
|
|
enable = true;
|
|
|
|
package = treefmtWrapper;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-10-28 13:12:06 +00:00
|
|
|
}
|
2024-10-28 13:11:40 +00:00
|
|
|
)
|