about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/services/gerrit/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/services/gerrit/default.nix b/modules/services/gerrit/default.nix
index 485bd58..a56dc7e 100644
--- a/modules/services/gerrit/default.nix
+++ b/modules/services/gerrit/default.nix
@@ -1,6 +1,17 @@
 { config, pkgs, lib, ... }:
 let
   cfg = config.my.services.gerrit;
+
+  my-gerrit-hook = name:
+    pkgs.writeShellScript "my-gerrit-hook" ''
+      exec -a ${name} ${pkgs.tools.gerrit-hook}/bin/gerrit-hook "$@"
+    '';
+
+  gerritHooks = pkgs.runCommandNoCC "gerrit-hooks" { } ''
+    mkdir -p $out
+    ln -s ${my-gerrit-hook "patchset-created"} $out/patchset-created
+  '';
+
   oauth = pkgs.fetchurl {
     url =
       "https://github.com/davido/gerrit-oauth-provider/releases/download/v3.5.1/gerrit-oauth-provider.jar";
@@ -43,6 +54,7 @@ in {
         log.jsonLogging = true;
         log.textLogging = false;
         sshd.advertisedAddress = "git.fcuny.net:29418";
+        hooks.path = "${gerritHooks}";
         cache.web_sessions.maxAge = "3 months";
         plugins.allowRemoteAdmin = false;
         change.enableAttentionSet = true;