summary refs log tree commit diff stats
path: root/modules/matrix/mautrix-whatsapp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/matrix/mautrix-whatsapp.nix')
-rw-r--r--modules/matrix/mautrix-whatsapp.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/matrix/mautrix-whatsapp.nix b/modules/matrix/mautrix-whatsapp.nix
new file mode 100644
index 0000000..a7322d2
--- /dev/null
+++ b/modules/matrix/mautrix-whatsapp.nix
@@ -0,0 +1,56 @@
+{ pkgs, libs, config, ... }:
+{
+
+  services.mautrix-whatsapp = {
+    enable = true;
+    settings = {
+
+      appservice = {
+        as_token = "";
+        bot = {
+          displayname = "WhatsApp Bridge Bot";
+          username = "whatsappbot";
+        };
+        database = {
+          type = "sqlite3";
+          uri = "/var/lib/mautrix-whatsapp/mautrix-whatsapp.db";
+        };
+        hostname = "[::]";
+        hs_token = "";
+        id = "whatsapp";
+        port = 29318;
+      };
+
+      bridge = {
+        command_prefix = "!wa";
+        displayname_template = "{{if .BusinessName}}{{.BusinessName}}{{else if .PushName}}{{.PushName}}{{else}}{{.JID}}{{end}} (WA)";
+        double_puppet_server_map = { };
+        login_shared_secret_map = { };
+        permissions = {
+          "krinitsin.com" = "admin";
+        };
+        relay = {
+          enabled = true;
+        };
+        username_template = "whatsapp_{{.}}";
+      };
+
+      homeserver = {
+        address = "http://localhost:8008";
+      };
+
+      logging = {
+        min_level = "info";
+        writers = [
+          {
+            format = "pretty-colored";
+            time_format = " ";
+            type = "stdout";
+          }
+        ];
+      };
+
+    };
+  };
+
+}