]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/im/default.nix
Add ejabberd service and website
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / im / default.nix
diff --git a/modules/private/websites/tools/im/default.nix b/modules/private/websites/tools/im/default.nix
new file mode 100644 (file)
index 0000000..9744d8e
--- /dev/null
@@ -0,0 +1,37 @@
+{ config, lib, ... }:
+let
+  cfg = config.myServices.websites.tools.im;
+in
+{
+  options.myServices.websites.tools.im = {
+    enable = lib.mkEnableOption "enable im website";
+  };
+
+  config = lib.mkIf cfg.enable {
+    services.websites.env.tools.vhostConfs.im = {
+      certName   = "eldiron";
+      addToCerts = true;
+      hosts      = ["im.immae.fr"];
+      root       = ./www;
+      extraConfig = [
+        ''
+          Alias /converse ${./www}/converse.html
+          ProxyPreserveHost On
+          <Location "/bosh">
+            ProxyPass http://localhost:5280/bosh
+            ProxyPassReverse http://localhost:5280/bosh
+          </Location>
+          <Location "/ws">
+            ProxyPass ws://localhost:5280/ws
+          </Location>
+          ProxyPass /upload http://localhost:5280/upload
+          ProxyPassReverse /upload http://localhost:5280/upload
+          ProxyPass /admin http://localhost:5280/admin
+          ProxyPassReverse /admin http://localhost:5280/admin
+          ProxyPass /api http://localhost:5280/api
+          ProxyPassReverse /api http://localhost:5280/api
+          ''
+      ];
+    };
+  };
+}