Add conduit
This commit is contained in:
parent
3e200c896a
commit
40682e946f
|
@ -7,6 +7,7 @@
|
|||
./services/nextcloud.nix
|
||||
./services/webserver.nix
|
||||
./services/starbound.nix
|
||||
./services/conduit.nix
|
||||
./ids.nix
|
||||
];
|
||||
|
||||
|
@ -38,7 +39,7 @@
|
|||
useDHCP = false;
|
||||
interfaces.eth0.useDHCP = true;
|
||||
|
||||
firewall.allowedTCPPorts = [ 80 443 2222 2221 25565 21025 ];
|
||||
firewall.allowedTCPPorts = [ 80 443 2222 2221 8448 25565 21025 ];
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
|
|
49
configuration/services/conduit.nix
Normal file
49
configuration/services/conduit.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.lists) flatten;
|
||||
|
||||
domain = config.services.nginx.domain;
|
||||
server_name = "matrix.${domain}";
|
||||
in {
|
||||
services.matrix-conduit = {
|
||||
enable = true;
|
||||
settings.global = {
|
||||
inherit server_name;
|
||||
address = "127.0.0.1";
|
||||
database_backend = "rocksdb";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
virtualHosts."${server_name}" = {
|
||||
listen = flatten (map (port: [
|
||||
{
|
||||
inherit port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
{
|
||||
inherit port;
|
||||
addr = "[::0]";
|
||||
ssl = true;
|
||||
}
|
||||
]) [443 8448]);
|
||||
|
||||
locations."/_matrix/" = {
|
||||
proxyPass = "http://127.0.0.1:6167";
|
||||
extraConfig = ''
|
||||
proxy_buffering off;
|
||||
'';
|
||||
};
|
||||
onlySSL = true;
|
||||
enableACME = true;
|
||||
|
||||
extraConfig = ''
|
||||
merge_slashes off;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue