chore: add module for formatting

This will export a check for formatting and makes `nix fmt` use treefmt
This commit is contained in:
DavHau
2023-07-12 19:00:09 +02:00
parent af94d11b1a
commit 4036df90d2
4 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
{self, inputs, ...}: {
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = {
pkgs,
...
}: {
treefmt.projectRootFile = "flake.nix";
treefmt.flakeCheck = true;
treefmt.flakeFormatter = true;
treefmt.programs.alejandra.enable = true;
treefmt.programs.shellcheck.enable = true;
};
}

View File

@@ -0,0 +1,4 @@
{ self, ... }: {
pre-commit.settings.hooks.alejandra.enable = true;
pre-commit.settings.hooks.shellcheck.enable = true;
}