summary refs log tree commit diff stats
path: root/system/services/matrix/default.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-27 09:45:30 +0200
committerSoispha <soispha@vhack.eu>2023-07-27 09:45:30 +0200
commit7fe499ee1ff7ecd88b4ecfc96b200ed2704468a7 (patch)
tree6fd8244d093aec15999cbebb6d12a54f4a7b679c /system/services/matrix/default.nix
parentFix(system/mail): Add User (diff)
downloadnixos-server-7fe499ee1ff7ecd88b4ecfc96b200ed2704468a7.tar.gz
nixos-server-7fe499ee1ff7ecd88b4ecfc96b200ed2704468a7.zip
Feat(system/services/matrix/bridges): Add mautrix-whatsapp bridge
Diffstat (limited to '')
-rw-r--r--system/services/matrix/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/system/services/matrix/default.nix b/system/services/matrix/default.nix
index 62345a7..5fe9e9b 100644
--- a/system/services/matrix/default.nix
+++ b/system/services/matrix/default.nix
@@ -12,6 +12,10 @@
     return 200 '${builtins.toJSON data}';
   '';
 in {
+  imports = [
+    ./bridges/mautrix-whatsapp.nix
+  ];
+
   networking.firewall.allowedTCPPorts = [80 443];
 
   services.postgresql.enable = true;
@@ -52,6 +56,29 @@ in {
     };
   };
 
+  services.mautrix-whatsapp = {
+    enable = true;
+    settings = {
+      appservice = {
+        database = {
+          type = "postgres";
+          uri = "postgres:///dbname?host=/var/run/postgresql";
+        };
+        whatsapp = {
+          # TODO: See https://github.com/tulir/whatsmeow/blob/efc632c008604016ddde63bfcfca8de4e5304da9/binary/proto/def.proto#L43-L64 for a list.
+          # This also determints the whatsapp icon
+          browser_name = "unknown";
+        };
+      };
+      homeserver.address = "https://matrix.vhack.eu";
+      bridge.permissions = {
+        "@soispha:vhack.eu" = "admin";
+        "@sils:vhack.eu" = "admin";
+        "@nightingale:vhack.eu" = "admin";
+      };
+    };
+  };
+
   services.matrix-synapse = {
     enable = true;
     dataDir = "/var/lib/matrix";