From d05ec52df2e06ab30f1b3be62aab8af65ecbdee1 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Fri, 10 Jul 2026 02:13:57 +0530 Subject: feat: added git commit hook check to prevent committing the private modules --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 3a28b51..70438e9 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,15 @@ { ... }: { git-hooks.hooks.nixfmt.enable = true; + + git-hooks.hooks.forbid-private = { + enable = true; + name = "Forbid committing private files"; + entry = "found private file in staging! Do not commit files under modules/private/ (except .example.nix files)."; + language = "fail"; + files = "modules/private/"; + excludes = [ "\\.example\\.nix$" ]; + }; } ) ]; -- cgit v1.2.3