kubernetes-deployments/formatter.nix

28 lines
594 B
Nix
Raw Normal View History

2024-10-28 15:03:01 +00:00
{
self,
nixpkgs,
treefmt-nix,
flake-utils,
2024-10-30 20:19:13 +00:00
git-hooks,
2024-10-28 15:03:01 +00:00
...
}:
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;
2024-10-30 20:19:13 +00:00
checks.pre-commit-check = git-hooks.lib.${system}.run {
2024-10-28 15:03:01 +00:00
src = ./.;
hooks = {
treefmt = {
enable = true;
package = treefmtWrapper;
};
};
};
}
)