From 41d783410776432d00c1bc38d41fdd482417af87 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 3 Jun 2025 14:56:04 +0200 Subject: [PATCH] add git-hook script that automatically updates git hooks --- configuration.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configuration.nix b/configuration.nix index 9bfd10c..17e1a4c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -101,6 +101,21 @@ 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; -- 2.50.1