2023-05-11 05:33:08 +07:00
|
|
|
{ config
|
|
|
|
, lib
|
2023-06-27 15:25:19 +07:00
|
|
|
, pkgs
|
2023-05-11 05:33:08 +07:00
|
|
|
, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.server;
|
|
|
|
in {
|
2023-11-29 01:52:15 +07:00
|
|
|
services.nginx.virtualHosts."matrix.${cfg.domainName}".locations = let
|
|
|
|
inherit (config.services.maubot) settings;
|
|
|
|
in {
|
2023-05-11 05:33:08 +07:00
|
|
|
"/_matrix/maubot/" = {
|
2023-11-29 01:52:15 +07:00
|
|
|
proxyPass = "http://${lib.quoteListenAddr settings.server.hostname}:${toString settings.server.port}";
|
2023-05-11 05:33:08 +07:00
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
2023-06-27 15:25:19 +07:00
|
|
|
services.maubot.enable = true;
|
|
|
|
services.maubot.settings = {
|
2023-06-29 03:10:41 +07:00
|
|
|
database = "postgresql://maubot@localhost/maubot";
|
2023-06-27 15:25:19 +07:00
|
|
|
server.public_url = "https://matrix.${cfg.domainName}";
|
2023-05-11 05:33:08 +07:00
|
|
|
};
|
2023-06-27 15:25:19 +07:00
|
|
|
services.maubot.plugins = with config.services.maubot.package.plugins; [
|
2023-07-12 03:26:50 +07:00
|
|
|
weather
|
|
|
|
urban
|
|
|
|
media
|
|
|
|
reactbot
|
|
|
|
reminder
|
|
|
|
translate
|
|
|
|
rss
|
2023-06-27 15:25:19 +07:00
|
|
|
];
|
2023-11-21 04:46:52 +07:00
|
|
|
services.maubot.pythonPackages = with pkgs.python3.pkgs; [
|
2023-06-27 15:25:19 +07:00
|
|
|
levenshtein
|
2024-06-06 23:20:08 +07:00
|
|
|
pillow
|
2023-11-21 04:46:52 +07:00
|
|
|
];
|
2023-05-11 05:33:08 +07:00
|
|
|
}
|