configuration.nix/hosts/rico1/services/dendrite/default.nix

30 lines
897 B
Nix
Raw Normal View History

2023-11-04 16:12:45 +05:30
{ pkgs, ... }: {
2023-10-29 23:26:49 +05:30
services = {
caddy.virtualHosts."matrix.adtya.xyz" = {
extraConfig = ''
reverse_proxy /_matrix/* 127.0.0.1:8008
2023-10-30 01:33:54 +05:30
reverse_proxy /_synapse/* 127.0.0.1:8008
2023-10-29 23:26:49 +05:30
'';
};
};
systemd.services.dendrite = {
description = "Dendrite Matrix homeserver";
2023-11-04 16:12:45 +05:30
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
2023-10-29 23:26:49 +05:30
serviceConfig = {
Type = "simple";
2023-10-29 23:38:56 +05:30
DynamicUser = true;
StateDirectory = "dendrite";
WorkingDirectory = "/var/lib/dendrite";
RuntimeDirectory = "dendrite";
RuntimeDirectoryMode = "0700";
2023-10-29 23:26:49 +05:30
LimitNOFILE = 65535;
ExecStart = ''
${pkgs.dendrite}/bin/dendrite -http-bind-address 127.0.0.1:8008 -https-bind-address 127.0.0.1:8448 -config ${./config.yaml}
'';
2023-10-29 23:38:56 +05:30
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Restart = "on-failure";
2023-10-29 23:26:49 +05:30
};
};
}