1
0
Fork 0
dotfiles/system/nixos/matrix/mautrix-whatsapp.nix
Daniel Kempkens 650be0e27e
All checks were successful
Update Flake / update-flake (push) Successful in 3m20s
Build / build-arm64-linux (push) Successful in 12m23s
Build / build-amd64-linux (push) Successful in 28s
chore: use lib.getExe in more places
2023-12-14 00:29:09 +01:00

30 lines
1,013 B
Nix

{ pkgs, config, lib, ... }:
{
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}" ];
ExecStart = "${lib.getExe pkgs.mautrix-whatsapp} --config=%d/config --no-update";
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"
];
}