about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-26T00·19+0000
committerVincent Ambo <tazjin@google.com>2020-05-26T00·19+0000
commitb9b741287a81ea5bc89b3dc865ed38315b465824 (patch)
treeceb90712e58b48c7021fd7a212c6b27c19e7b108 /ops
parent587b0a8b0be72468214d2b98df3d3b83677c9abb (diff)
feat(ops/nixos/camden): Set up hound at cs.tazj.in r/855
Diffstat (limited to 'ops')
-rw-r--r--ops/nixos/camden/default.nix32
1 files changed, 30 insertions, 2 deletions
diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix
index 9d80059615..1039cb2a21 100644
--- a/ops/nixos/camden/default.nix
+++ b/ops/nixos/camden/default.nix
@@ -8,6 +8,7 @@ config: let
 in lib.fix(self: {
   imports = [
     ../modules/depot.nix
+    ../modules/hound.nix
   ];
   depot = depot;
 
@@ -107,7 +108,6 @@ in lib.fix(self: {
     (with depot; [
       fun.idual.script
       fun.idual.setAlarm
-      third_party.git
       third_party.honk
       third_party.pounce
     ]) ++
@@ -119,6 +119,7 @@ in lib.fix(self: {
       direnv
       emacs26-nox
       gnupg
+      git
       htop
       jq
       pass
@@ -213,6 +214,7 @@ in lib.fix(self: {
       group = "nginx";
       webroot = "/var/lib/acme/acme-challenge";
       extraDomains = {
+        "cs.tazj.in" = null;
         "git.tazj.in" = null;
         "www.tazj.in" = null;
 
@@ -239,7 +241,21 @@ in lib.fix(self: {
     applicationCredentials = "/etc/gcp/key.json";
   };
 
-  # serve my website
+  # Serve a code search (hound) instance
+  services.depot.hound = {
+    enable = true;
+    title = "tazjin's depot";
+    repos.depot = {
+      url = "file:///var/git/depot";
+      vcs = "git";
+      url-pattern = {
+        base-url = "https://git.tazj.in/tree/{path}{anchor}";
+        anchor = "#n{line}";
+      };
+    };
+  };
+
+  # serve my website(s)
   services.nginx = {
     enable = true;
     enableReload = true;
@@ -357,6 +373,18 @@ in lib.fix(self: {
         }
       '';
     };
+
+    virtualHosts.hound = {
+      serverName = "cs.tazj.in";
+      useACMEHost = "tazj.in";
+      forceSSL = true;
+
+      extraConfig = ''
+        location / {
+          proxy_pass http://localhost:6080;
+        }
+      '';
+    };
   };
 
   # Timer units that can be started with systemd-run to set my alarm.