chore: add module for formatting
This will export a check for formatting and makes `nix fmt` use treefmt
This commit is contained in:
15
flake-parts/formatting.nix
Normal file
15
flake-parts/formatting.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
4
flake-parts/pre-commit.nix
Normal file
4
flake-parts/pre-commit.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ self, ... }: {
|
||||
pre-commit.settings.hooks.alejandra.enable = true;
|
||||
pre-commit.settings.hooks.shellcheck.enable = true;
|
||||
}
|
||||
Reference in New Issue
Block a user