]> gitweb.ps.run Git - flake_server/commitdiff
add git-hook script that automatically updates git hooks
authorPatrick <patrick.schoenberger@posteo.de>
Tue, 3 Jun 2025 12:56:04 +0000 (14:56 +0200)
committerPatrick <patrick.schoenberger@posteo.de>
Tue, 3 Jun 2025 12:56:04 +0000 (14:56 +0200)
configuration.nix

index 9bfd10cb1f7c97a86ada6c08054e7f0fffd8e79c..17e1a4c273c095da6b16eebaaf120c09e296253a 100644 (file)
     senc = "sudo ${pkgs.helix}/bin/hx /etc/nixos/configuration.nix";
   };
 
+  # git-hooks
+  system.activationScripts.githook =
+    let
+      githooksRepo = pkgs.fetchgit {
+        url = "git://psch.dev/git-hooks";
+        rev = "1071cff3ca2626dca967eb0989c0874764c460e2";
+        hash = "sha256-dvTchTWvIlsqkU+iYm11kVTPr2B2LrCAdhZkmOoLRzA=";
+      };
+    in
+    {
+    text = ''
+      PATH=$PATH:${lib.makeBinPath [ pkgs.git pkgs.sudo pkgs.python3 ]} sudo -u git ${githooksRepo}/git-hooks/post-receive
+    '';
+  };
+
   # git
   users.users.git = {
     isSystemUser = true;