27 lines
594 B
Nix
27 lines
594 B
Nix
{
|
|
self,
|
|
nixpkgs,
|
|
treefmt-nix,
|
|
flake-utils,
|
|
git-hooks,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system: let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
|
treefmtWrapper = treefmtEval.config.build.wrapper;
|
|
in {
|
|
packages.formatter = treefmtWrapper;
|
|
formatter = self.packages.${system}.formatter;
|
|
checks.pre-commit-check = git-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = {
|
|
treefmt = {
|
|
enable = true;
|
|
package = treefmtWrapper;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
)
|