ctucx.git: nixfiles

ctucx' nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 { config, pkgs, ...  }:

{

  users.users.matrix-synapse.extraGroups = [
    "mautrix-whatsapp"
  ];

  services.mautrix-whatsapp = {
    enable   = true;
    settings = {
      homeserver.address = "https://matrix.ctu.cx";
      homeserver.domain  = "ctu.cx";

      metrics.enabled = true;

      whatsapp.os_name = "Mautrix-WhatsApp bridge (ctu.cx)";

      appservice = {
        address  = "http://localhost:29318";
        hostname = "[::1]";
        port     =  29318;

        id = "whatsapp";

        database.type = "sqlite3-fk-wal";
        database.uri  = "file:/var/lib/mautrix-whatsapp/mautrix-whatsapp.db?_txlock=immediate";
      };

      bridge = {
        command_prefix       = "!wa";
        displayname_template = "{{if .BusinessName}}{{.BusinessName}}{{else if .PushName}}{{.PushName}}{{else}}{{.JID}}{{end}} (WA)";
        username_template    = "whatsapp_{{.}}";

        delivery_receipts         = true;
        message_status_events     = true;
        message_error_notices     = true;
        call_start_notices        = true;
        identity_change_notices   = true;
        user_avatar_sync          = true;
        personal_filtering_spaces = true;

        encryption.allow = true;

        permissions = {
          "ctu.cx" = "user";
        };

        history_sync = {
          backfill = true;
          message_count = 250;
          request_full_sync = true;
        };

        relay = {
          enabled = true;
        };
      };

    };
  };

}