about summary refs log tree commit diff
path: root/nix/tazserve.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/tazserve.nix')
-rw-r--r--nix/tazserve.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nix/tazserve.nix b/nix/tazserve.nix
index 10fd1d1cbf58..f9aee1a57032 100644
--- a/nix/tazserve.nix
+++ b/nix/tazserve.nix
@@ -14,6 +14,11 @@ blogConfig = {
     proxyPass = "http://127.0.0.1:8000";
   };
 };
+gemma = import ./pkgs/gemma.nix { inherit pkgs; };
+gemmaConfig = writeTextFile {
+  name = "config.lisp";
+  text = builtins.readFile ./gemma-config.lisp;
+};
 in {
   # Ensure that blog software is installed
   environment.systemPackages = [
@@ -47,6 +52,18 @@ in {
     rootUrl      = "https://git.tazj.in/";
   };
 
+  # Set up Gemma
+  systemd.services.gemma = {
+    description           = "Recurring task tracking app";
+    script                = "${gemma}/bin/gemma";
+    serviceConfig.Restart = "always";
+    wantedBy              = [ "multi-user.target" ];
+
+    environment = {
+      GEMMA_CONFIG = "${gemmaConfig}";
+    };
+  };
+
   # Set up reverse proxy
   services.nginx = {
     enable = true;
@@ -72,5 +89,14 @@ in {
       forceSSL   = true;
       extraConfig = "return 302 https://www.google.com/maps/d/viewer?mid=1pJIYY9cuEdt9DuMTbb4etBVq7hs;";
     };
+
+    # Gemma demo instance!
+    virtualHosts."gemma.tazj.in" = {
+      enableACME = true;
+      forceSSL   = true;
+      locations."/" = {
+        proxyPass = "http://127.0.0.1:4242";
+      };
+    };
   };
 }