Let's try this, it won't work probably but to build on and get the cert

This commit is contained in:
Lillian Violet 2024-01-22 17:08:52 +01:00
parent eed5ef0180
commit 66603bc3f8

View file

@ -5,59 +5,25 @@
config, config,
pkgs, pkgs,
... ...
}: let }: {
# You'll need to edit these values
# The hostname that will appear in your user and room IDs
server_name = "matrix.gladtherescake.eu";
# The hostname that Conduit actually runs on
#
# This can be the same as `server_name` if you want. This is only necessary
# when Conduit is running on a different machine than the one hosting your
# root domain. This configuration also assumes this is all running on a single
# machine, some tweaks will need to be made if this is not the case.
matrix_hostname = "${server_name}";
in {
# Configure Conduit itself
services.matrix-conduit = { services.matrix-conduit = {
enable = true; enable = true;
# This causes NixOS to use the flake defined in this repository instead of
# the build of Conduit built into nixpkgs.
package = pkgs.matrix-conduit;
settings.global = { settings.global = {
inherit server_name; allow_registration = true;
server_name = "matrix.gladtherescake.eu";
port = 6167;
}; };
}; };
# ACME data must be readable by the NGINX user
users.users.nginx.extraGroups = [
"acme"
];
# Configure NGINX as a reverse proxy
services.nginx = { services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = { virtualHosts = {
"${matrix_hostname}" = { "matrix.gladtherescake.eu" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = {
listen = [ proxyPass = "http://localhost:6167";
{ proxyWebsockets = true;
addr = "0.0.0.0"; };
port = 443;
ssl = true;
}
{
addr = "0.0.0.0";
port = 8448;
ssl = true;
}
];
}; };
}; };
}; };