feat(monorepo-gerrit): Enable Gerrit hooks & configure besadii

Loads the 'hooks' plugin into Gerrit, which - as per my interpretation
of the docs - is going to execute any hooks for which there are
matching binaries.

The intention here is that besadii should implement most of the hooks
we care about. As a start, it is symlinked here to the `ref-updated`
hook.

Change-Id: I6482a9d71cc08908c29dd10f786cbba32b33d04d
This commit is contained in:
Vincent Ambo 2020-06-13 06:02:19 +01:00
parent b094e65bfc
commit b88cbe0dab

View file

@ -1,19 +1,28 @@
# Gerrit configuration for the TVL monorepo
{ pkgs, config, lib, ... }:
let cfg = config.services.gerrit;
let
cfg = config.services.gerrit;
gerritHooks = pkgs.runCommandNoCC "gerrit-hooks" {} ''
mkdir -p $out/bin
ln -s ${config.depot.ops.besadii}/bin/besadii $out/bin/ref-updated
'';
in {
services.gerrit = {
enable = true;
listenAddress = "[::]:4778"; # 4778 - grrt
serverId = "4fdfa107-4df9-4596-8e0a-1d2bbdd96e36";
builtinPlugins = [ "download-commands" ];
builtinPlugins = [
"download-commands"
"hooks"
];
settings = {
core.packedGitLimit = "100m";
log.jsonLogging = true;
log.textLogging = false;
sshd.advertisedAddress = "code.tvl.fyi:29418";
hooks.path = "${gerritHooks}";
# Configures gerrit for being reverse-proxied by nginx as per
# https://gerrit-review.googlesource.com/Documentation/config-reverseproxy.html