diff --git a/hosts/hitsugibune/matrix.nix b/hosts/hitsugibune/matrix.nix index b4e7e2d..290e6d9 100644 --- a/hosts/hitsugibune/matrix.nix +++ b/hosts/hitsugibune/matrix.nix @@ -23,6 +23,12 @@ in { group = "mautrix-signal"; }; + age.secrets.mautrix-whatsapp = { + file = ../../secrets/mautrix-signal.age; + owner = "mautrix-whatsapp"; + group = "mautrix-whatsapp"; + }; + age.secrets.coturn = { file = ../../secrets/coturn.age; owner = "turnserver"; @@ -233,10 +239,45 @@ in { provisioning = { shared_secret = "$PROVISIONING_SHARED_SECRET"; }; + }; + }; - network = { - # INFO: If I ever decide to run this for multiple people this option isnt safe -> change to false - use_contact_avatars = true; + services.mautrix-whatsapp = { + enable = true; + environmentFile = config.age.secrets.mautrix-whatsapp.path; + settings = { + homeserver = { + address = "http://localhost:8008"; + name = config.networking.domain; + }; + # This will break sooner or later when the new config arrives + # https://github.com/NixOS/nixpkgs/pull/420722 + + backfill = { + enabled = true; + }; + + bridge = { + message_status_events = true; + + encryption = { + allow = true; + default = true; + require = false; + pickle_key = "$ENCRYPTION_PICKLE_KEY"; + }; + + history_sync.backfill = true; + + permissions = { + "*" = "relay"; + "sprechtl.me" = "user"; + "@spr3ez:sprechtl.me" = "admin"; + }; + + provisioning = { + shared_secret = "$PROVISIONING_SHARED_SECRET"; + }; }; }; }; diff --git a/secrets/mautrix-whatsapp.age b/secrets/mautrix-whatsapp.age new file mode 100644 index 0000000..f4cb014 Binary files /dev/null and b/secrets/mautrix-whatsapp.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index c26c18b..1971ec9 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -8,5 +8,6 @@ in { "speedtest-tracker.age".publicKeys = [saberofxebec key]; "matrix.age".publicKeys = [hitsugibune key]; "mautrix-signal.age".publicKeys = [hitsugibune key]; + "mautrix-whatsapp.age".publicKeys = [hitsugibune key]; "coturn.age".publicKeys = [hitsugibune key]; }