diff --git a/flake.nix b/flake.nix index 4623fa7..0a19c48 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,14 @@ }; nur.url = "github:nix-community/NUR"; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-compat.follows = "flake-compat"; + }; + }; + flake-compat.url = "github:edolstra/flake-compat"; }; outputs = { diff --git a/pre-commit-hooks.nix b/pre-commit-hooks.nix new file mode 100644 index 0000000..fcd5653 --- /dev/null +++ b/pre-commit-hooks.nix @@ -0,0 +1,15 @@ +{inputs, ...}: { + imports = [inputs.pre-commit-hooks.flakeModule]; + + perSystem.pre-commit = { + settings.excludes = ["flake.lock"]; + + settings.hooks = { + alejandra.enable = true; + prettier = { + enable = true; + excludes = [".js" ".md" ".ts"]; + }; + }; + }; +}