diff --git a/modules/services/server/matrix.nix b/modules/services/server/matrix.nix index bd98e4e..8e9b3cc 100644 --- a/modules/services/server/matrix.nix +++ b/modules/services/server/matrix.nix @@ -17,9 +17,11 @@ let return 200 '${builtins.toJSON data}'; ''; in { - environment.systemPackages = { + environment.systemPackages = [ pkgs.mautrix-whatsapp - }; + pkgs.signald + pkgs.mautrix-signal + ]; services.nginx = { enable = true; @@ -100,6 +102,17 @@ in { Group = "mautrix-whatsapp"; }; }; + mautrix-signal = { + description = "Matrix <-> Signal bridge"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "postgresql.service" "matrix-synapse.service" ]; + requires = [ "postgresql.service" "matrix-synapse.service" "signald"]; + script = "${pkgs.mautrix-signal}/bin/mautrix-signal --config ${config.age.secrets."services/matrix/mautrix-signal.yml".path}"; + serviceConfig = { + User = "mautrix-signal"; + Group = "mautrix-signal"; + }; + }; }; users = { @@ -176,6 +189,9 @@ in { }; }; }; + signald = { + enable = true; + }; }; age.secrets."services/matrix/synapse.yml" = { @@ -190,6 +206,10 @@ in { file = ../../../secrets/services/matrix/mautrix-whatsapp.age; owner = "mautrix-whatsapp"; }; + age.secrets."services/matrix/mautrix-signal.yml" = { + file = ../../../secrets/services/matrix/mautrix-signal.age; + owner = "mautrix-signal"; + }; age.secrets."services/matrix/telegram-registration.yml" = { file = ../../../secrets/services/matrix/telegram-registration.age; owner = "matrix-synapse"; @@ -198,5 +218,9 @@ in { file = ../../../secrets/services/matrix/whatsapp-registration.age; owner = "matrix-synapse"; }; + age.secrets."services/matrix/signal-registration.yml" = { + file = ../../../secrets/services/matrix/signal-registration.age; + owner = "matrix-synapse"; + }; } diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 745cfe6..23f4e84 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -38,6 +38,8 @@ in "services/matrix/telegram-registration.age".publicKeys = servers ++ users; "services/matrix/mautrix-whatsapp.age".publicKeys = servers ++ users; "services/matrix/whatsapp-registration.age".publicKeys = servers ++ users; + "services/matrix/mautrix-signal.age".publicKeys = servers ++ users; + "services/matrix/signal-registration.age".publicKeys = servers ++ users; "services/nextcloud/adminpassFile.age".publicKeys = servers ++ users; "services/nextcloud/dbpassFile.age".publicKeys = servers ++ users; } diff --git a/secrets/services/matrix/mautrix-signal.age b/secrets/services/matrix/mautrix-signal.age new file mode 100644 index 0000000..8312d76 Binary files /dev/null and b/secrets/services/matrix/mautrix-signal.age differ diff --git a/secrets/services/matrix/mautrix-whatsapp.age b/secrets/services/matrix/mautrix-whatsapp.age index 9561171..4afe297 100644 Binary files a/secrets/services/matrix/mautrix-whatsapp.age and b/secrets/services/matrix/mautrix-whatsapp.age differ