about summary refs log tree commit diff
path: root/users/tazjin/nixos/modules
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-04-16T20·21+0200
committertazjin <tazjin@tvl.su>2022-04-16T20·35+0000
commit78c966dc78e12bd00cac3987f4f221a760850010 (patch)
treedf4baefa0470f8edb7bb88e0c92538ac66548b12 /users/tazjin/nixos/modules
parent792de59c64b4a018206e316b6b70db65274c2737 (diff)
feat(tazjin/polyanka): deploy a tgsa instance r/3966
Change-Id: I8a32c093eb0ac8f6a0c3cfbb358d46d97d0c3b17
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5469
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'users/tazjin/nixos/modules')
-rw-r--r--users/tazjin/nixos/modules/default.nix2
-rw-r--r--users/tazjin/nixos/modules/tgsa.nix24
2 files changed, 26 insertions, 0 deletions
diff --git a/users/tazjin/nixos/modules/default.nix b/users/tazjin/nixos/modules/default.nix
new file mode 100644
index 000000000000..d747e8e1319a
--- /dev/null
+++ b/users/tazjin/nixos/modules/default.nix
@@ -0,0 +1,2 @@
+# Make readTree happy at this level.
+_: { }
diff --git a/users/tazjin/nixos/modules/tgsa.nix b/users/tazjin/nixos/modules/tgsa.nix
new file mode 100644
index 000000000000..82b2bec44acd
--- /dev/null
+++ b/users/tazjin/nixos/modules/tgsa.nix
@@ -0,0 +1,24 @@
+{ config, depot, lib, pkgs, ... }:
+
+{
+  systemd.services.tgsa = {
+    description = "telegram -> SA bbcode thing";
+    wantedBy = [ "multi-user.target" ];
+
+    serviceConfig = {
+      DynamicUser = true;
+      Restart = "always";
+      ExecStart = "${depot.users.tazjin.tgsa}/bin/tgsa";
+    };
+  };
+
+  services.nginx.virtualHosts."tgsa" = {
+    serverName = "tgsa.tazj.in";
+    enableACME = true;
+    forceSSL = true;
+
+    locations."/" = {
+      proxyPass = "http://localhost:8472";
+    };
+  };
+}