server/maubot: cleanup

This commit is contained in:
chayleaf 2023-11-29 01:52:15 +07:00
parent 28010a5ebe
commit 3250edc21c
Signed by: chayleaf
GPG key ID: 78171AD46227E68E

View file

@ -5,48 +5,18 @@
let let
cfg = config.server; cfg = config.server;
# i've yet to create a maubot module so this is hardcoded
maubotAddr = "127.0.0.1";
maubotPort = 29316;
in { in {
impermanence.directories = [ impermanence.directories = [
{ directory = /var/lib/maubot; user = "maubot"; group = "maubot"; mode = "0755"; } { directory = /var/lib/maubot; user = "maubot"; group = "maubot"; mode = "0755"; }
]; ];
services.nginx.virtualHosts."matrix.${cfg.domainName}".locations = { services.nginx.virtualHosts."matrix.${cfg.domainName}".locations = let
inherit (config.services.maubot) settings;
in {
"/_matrix/maubot/" = { "/_matrix/maubot/" = {
proxyPass = "http://${lib.quoteListenAddr maubotAddr}:${toString maubotPort}"; proxyPass = "http://${lib.quoteListenAddr settings.server.hostname}:${toString settings.server.port}";
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
/*users.users.maubot = {
home = "/var/lib/maubot";
group = "maubot";
isSystemUser = true;
};
users.groups.maubot = { };*/
/*systemd.services.maubot = {
description = "Maubot";
wants = [ "matrix-synapse.service" "nginx.service" ];
after = [ "matrix-synapse.service" "nginx.service" ];
wantedBy = [ "multi-user.target" ];
environment = {
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
};
serviceConfig = {
User = "maubot";
Group = "maubot";
WorkingDirectory = "/var/lib/maubot/data";
};
script = "${pkgs.python3.withPackages (pks: with pks; [
pkgs.maubot (pkgs.pineapplebot.override {
magic = cfg.pizzabotMagic;
}) feedparser levenshtein python-dateutil pytz
])}/bin/python3 -m maubot";
};*/
systemd.services.maubot = {
after = [ "nginx.service" ];
requires = [ "nginx.service" ];
};
services.maubot.enable = true; services.maubot.enable = true;
services.maubot.settings = { services.maubot.settings = {
database = "postgresql://maubot@localhost/maubot"; database = "postgresql://maubot@localhost/maubot";