From 393c40017394da93f705039446bb9206cc464839 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Wed, 16 Apr 2025 16:50:10 +0200 Subject: [PATCH] Revert "kill git hook" This reverts commit f7d050a3a60a130cc5ce5c89a413031438717e6b. --- flake.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/flake.nix b/flake.nix index 3cdb7e96..377448b3 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,23 @@ { formatter = pkgs.nixfmt-rfc-style; + pre-commit.settings.hooks = + let + ## Add a directory here if pre-commit hooks shouldn't apply to it. + optout = [ + "npins" + "launch/.terraform" + ]; + excludes = map (dir: "^${dir}/") optout; + addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; }); + in + addExcludes { + nixfmt-rfc-style.enable = true; + deadnix.enable = true; + trim-trailing-whitespace.enable = true; + shellcheck.enable = true; + }; + devShells.default = pkgs.mkShell { packages = [ pkgs.nil @@ -54,6 +71,7 @@ impureEnvVars = [ "DEPLOYMENT" ]; }) ]; + shellHook = config.pre-commit.installationScript; }; }; };