2023-12-13 23:29:09 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2023-08-01 16:32:28 +00:00
|
|
|
|
|
|
|
{
|
2024-01-30 19:40:21 +00:00
|
|
|
# Re-use old signald user and group
|
|
|
|
users.users.signald = {
|
|
|
|
group = "signald";
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups.signald = { };
|
2023-08-01 16:32:28 +00:00
|
|
|
|
|
|
|
systemd.services.mautrix-signal = {
|
|
|
|
description = "A Matrix-Signal puppeting bridge";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2024-01-30 19:40:21 +00:00
|
|
|
requires = [ "matrix-synapse.service" ];
|
|
|
|
after = [ "matrix-synapse.service" ];
|
2023-08-01 16:32:28 +00:00
|
|
|
restartTriggers = [ "${config.age.secrets.mautrix-signal-config.file}" ];
|
|
|
|
serviceConfig = {
|
2024-01-30 19:40:21 +00:00
|
|
|
User = "signald";
|
|
|
|
Group = "signald";
|
2023-08-01 16:32:28 +00:00
|
|
|
LoadCredential = [ "config:${config.age.secrets.mautrix-signal-config.path}" ];
|
2023-12-13 23:29:09 +00:00
|
|
|
ExecStart = "${lib.getExe pkgs.mautrix-signal} --config=%d/config --no-update";
|
2023-08-01 16:32:28 +00:00
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "5s";
|
|
|
|
|
|
|
|
StateDirectory = "mautrix-signal";
|
|
|
|
RuntimeDirectory = "mautrix-signal";
|
|
|
|
StateDirectoryMode = "0750";
|
|
|
|
RuntimeDirectoryMode = "0750";
|
|
|
|
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
ProtectControlGroups = true;
|
|
|
|
PrivateTmp = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.matrix-synapse.settings.app_service_config_files = [
|
|
|
|
"/var/lib/matrix-synapse/bridges/registration-signal.yaml"
|
|
|
|
];
|
|
|
|
}
|