2023-12-13 23:29:09 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2023-08-01 16:32:28 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
systemd.services.mautrix-whatsapp = {
|
|
|
|
description = "Matrix <-> Whatsapp hybrid puppeting/relaybot bridge";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
requires = [ "matrix-synapse.service" ];
|
|
|
|
after = [ "matrix-synapse.service" ];
|
|
|
|
restartTriggers = [ "${config.age.secrets.mautrix-whatsapp-config.file}" ];
|
|
|
|
serviceConfig = {
|
|
|
|
DynamicUser = true;
|
|
|
|
StateDirectory = "mautrix-whatsapp";
|
|
|
|
LoadCredential = [ "config:${config.age.secrets.mautrix-whatsapp-config.path}" ];
|
2023-12-13 23:29:09 +00:00
|
|
|
ExecStart = "${lib.getExe pkgs.mautrix-whatsapp} --config=%d/config --no-update";
|
2023-08-01 16:32:28 +00:00
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "5s";
|
|
|
|
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
ProtectControlGroups = true;
|
|
|
|
PrivateTmp = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.matrix-synapse.settings.app_service_config_files = [
|
|
|
|
"/var/lib/matrix-synapse/bridges/registration-whatsapp.yaml"
|
|
|
|
];
|
|
|
|
}
|