aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-10 02:13:57 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-10 02:13:57 +0530
commitd05ec52df2e06ab30f1b3be62aab8af65ecbdee1 (patch)
tree5ec63d106655065a0e079c2daa600c8cfb94e510
parentbf7a0f704a7ffc64d77f53d940f49f0bd9d4d35e (diff)
downloadhome-manager-config-d05ec52df2e06ab30f1b3be62aab8af65ecbdee1.tar.gz
home-manager-config-d05ec52df2e06ab30f1b3be62aab8af65ecbdee1.zip
feat: added git commit hook check to prevent committing the private modules
-rw-r--r--flake.nix9
1 files changed, 9 insertions, 0 deletions
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$" ];
+ };
}
)
];