about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-06-07T18·30+0100
committerVincent Ambo <tazjin@google.com>2020-06-11T21·13+0000
commitafe0841e9d696d3ac8ff447909c416c48ba90836 (patch)
tree4c48e3ca4313d3ddcb56f5327924e9843544a7a5
parentb7766431f480ebe0757c0d70101e99f5f6a5d6e5 (diff)
feat(ops/nixos): Add module for configuring Gerrit for the repo r/897
-rw-r--r--ops/nixos/camden/default.nix20
-rw-r--r--ops/nixos/modules/monorepo-gerrit.nix16
-rw-r--r--third_party/default.nix1
3 files changed, 36 insertions, 1 deletions
diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix
index 9496d14b5a..5db84ef50e 100644
--- a/ops/nixos/camden/default.nix
+++ b/ops/nixos/camden/default.nix
@@ -9,6 +9,8 @@ in lib.fix(self: {
   imports = [
     ../modules/depot.nix
     ../modules/hound.nix
+    ../modules/monorepo-gerrit.nix
+    "${pkgs.nixpkgsSrc}/nixos/modules/services/web-apps/gerrit.nix"
   ];
   depot = depot;
 
@@ -108,7 +110,6 @@ in lib.fix(self: {
     (with depot; [
       fun.idual.script
       fun.idual.setAlarm
-      third_party.honk
       third_party.pounce
     ]) ++
 
@@ -230,6 +231,11 @@ in lib.fix(self: {
       group = "nginx";
       webroot = "/var/lib/acme/acme-challenge";
       postRun = "systemctl reload nginx";
+      extraDomains = {
+        "cl.tvl.fyi" = null;
+        "code.tvl.fyi" = null;
+        "cs.tvl.fyi" = null;
+      };
     };
   };
 
@@ -395,6 +401,18 @@ in lib.fix(self: {
         }
       '';
     };
+
+    virtualHosts.gerrit = {
+      serverName = "cl.tvl.fyi";
+      useACMEHost = "tvl.fyi";
+      forceSSL = true;
+
+      extraConfig = ''
+        location / {
+          proxy_pass http://localhost:4778;
+        }
+      '';
+    };
   };
 
   # Timer units that can be started with systemd-run to set my alarm.
diff --git a/ops/nixos/modules/monorepo-gerrit.nix b/ops/nixos/modules/monorepo-gerrit.nix
new file mode 100644
index 0000000000..2b8e5e7738
--- /dev/null
+++ b/ops/nixos/modules/monorepo-gerrit.nix
@@ -0,0 +1,16 @@
+# Gerrit configuration for the TVL monorepo
+{ pkgs, config, lib, ... }:
+
+{
+  services.gerrit = {
+    enable = true;
+    listenAddress = "[::]:4778"; # 4778 - grrt
+    serverId = "4fdfa107-4df9-4596-8e0a-1d2bbdd96e36";
+    settings = {
+      core.packedGitLimit = "100m";
+      log.jsonLogging = true;
+      log.textLogging = false;
+      # TODO: gitweb config
+    };
+  };
+}
diff --git a/third_party/default.nix b/third_party/default.nix
index 9b62ede4d3..822d9f3234 100644
--- a/third_party/default.nix
+++ b/third_party/default.nix
@@ -58,6 +58,7 @@ let
       fira-mono
       fontconfig
       freetype
+      gerrit
       gettext
       glibc
       gmock