From 09af4dfb7ccf00f758ae2864d44e5457c56ef634 Mon Sep 17 00:00:00 2001 From: "Janik H." Date: Mon, 16 Sep 2024 19:26:30 +0200 Subject: [PATCH] feat(gerrit): run git-gc-preserve on a daily timer --- services/gerrit/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/services/gerrit/default.nix b/services/gerrit/default.nix index 4102368..71a37ca 100644 --- a/services/gerrit/default.nix +++ b/services/gerrit/default.nix @@ -318,6 +318,25 @@ in environment.REVWALK_USE_PRIORITY_QUEUE = "true"; }; + systemd.timers.gerrit-garbage-collect = { + wantedBy = [ "timers.target" ]; + after = [ "multi-user.target" ]; + timerConfig = { + OnCalendar = "daily"; + }; + }; + systemd.services.gerrit-garbage-collect = { + serviceConfig = { + WorkingDirectory = "/var/lib/gerrit/git"; + Type = "oneshot"; + User = "git"; + Group = "git"; + }; + script = '' + ${lib.getExe pkgs.git-gc-preserve} + ''; + }; + age.secrets.gerrit-prometheus-bearer-token.file = ../../secrets/gerrit-prometheus-bearer-token.age; bagel.monitoring.grafana-agent.exporters.gerrit = { port = 4778; # grrt