services: matrix add mautrix-whatsapp

This commit is contained in:
Kabbone 2022-12-30 08:39:07 +01:00
parent 7f7e66b68c
commit e7b1a0289c
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
2 changed files with 33 additions and 10 deletions

View File

@ -15,7 +15,7 @@
{
imports = # Import window or display manager.
[
#../modules/editors/nvim # ! Comment this out on first install !
../modules/editors/nvim # ! Comment this out on first install !
];
users.users.${user} = { # System User
@ -86,6 +86,7 @@
bind
dig
agenix.defaultPackage.x86_64-linux
ffmpeg
];
};

View File

@ -17,6 +17,10 @@ let
return 200 '${builtins.toJSON data}';
'';
in {
environment.systemPackages = {
pkgs.mautrix-whatsapp
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
@ -81,19 +85,21 @@ in {
];
};
age.secrets."services/matrix/synapse.yml" = {
file = ../../../secrets/services/matrix/synapse.age;
owner = "matrix-synapse";
};
age.secrets."services/matrix/telegram-registration.yml" = {
file = ../../../secrets/services/matrix/telegram-registration.age;
owner = "matrix-synapse";
};
systemd.services = {
matrix-synapse = {
requires = [ "postgresql.service" ];
};
mautrix-whatsapp = {
description = "Matrix <-> WhatsApp bridge";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "postgresql.service" "matrix-synapse.service" ];
requires = [ "postgresql.service" "matrix-synapse.service" ];
script = "${pkgs.mautrix-whatsapp}/bin/mautrix-whatsapp --config ${config.age.secrets."services/matrix/mautrix-whatsapp.yml".path}";
serviceConfig = {
User = "mautrix-whatsapp";
Group = "mautrix-whatsapp";
};
};
};
users = {
@ -172,9 +178,25 @@ in {
};
};
age.secrets."services/matrix/synapse.yml" = {
file = ../../../secrets/services/matrix/synapse.age;
owner = "matrix-synapse";
};
age.secrets."services/matrix/mautrix-telegram.env" = {
file = ../../../secrets/services/matrix/mautrix-telegram.age;
owner = "mautrix-telegram";
};
age.secrets."services/matrix/mautrix-whatsapp.yml" = {
file = ../../../secrets/services/matrix/mautrix-whatsapp.age;
owner = "mautrix-whatsapp";
};
age.secrets."services/matrix/telegram-registration.yml" = {
file = ../../../secrets/services/matrix/telegram-registration.age;
owner = "matrix-synapse";
};
age.secrets."services/matrix/whatsapp-registration.yml" = {
file = ../../../secrets/services/matrix/whatsapp-registration.age;
owner = "matrix-synapse";
};
}