summaryrefslogtreecommitdiff
path: root/modules/nixos/matrix-conduit.nix
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-01-26 21:40:03 +0100
committerandromeda <andromeda@lenovo>2026-01-26 21:40:03 +0100
commit8c0db96ca409b93313111352a2cc454281c8285e (patch)
tree41d2050a40ae15c26334898233791eeb4b7bc455 /modules/nixos/matrix-conduit.nix
parent2386fea0ebfedd486e8945b19b3ff4898c29a75e (diff)
robot, also continuwuity, also zramrobotnix
Diffstat (limited to 'modules/nixos/matrix-conduit.nix')
-rw-r--r--modules/nixos/matrix-conduit.nix82
1 files changed, 0 insertions, 82 deletions
diff --git a/modules/nixos/matrix-conduit.nix b/modules/nixos/matrix-conduit.nix
deleted file mode 100644
index d0fdf63..0000000
--- a/modules/nixos/matrix-conduit.nix
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- config,
- pkgs,
- ...
-}: let
- well_known_server = pkgs.writeText "well-known-matrix-server" ''
- {
- "m.server": "matrix.${config.services.matrix-conduit.settings.global.server_name}"
- }
- '';
- well_known_client = pkgs.writeText "well-known-matrix-client" ''
- {
- "m.homeserver": {
- "base_url": "https://matrix.${config.services.matrix-conduit.settings.global.server_name}"
- }
- '';
-in {
- services.matrix-conduit = {
- enable = true;
- settings.global = {
- server_name = "${config.networking.domain}";
- };
- };
- services.nginx = {
- enable = true;
- virtualHosts = {
- "matrix.${config.services.matrix-conduit.settings.global.server_name}" = {
- forceSSL = true;
- enableACME = true;
- listen = [
- {
- addr = "0.0.0.0";
- port = 443;
- ssl = true;
- }
- {
- addr = "0.0.0.0";
- port = 8448;
- ssl = true;
- }
- ];
- locations."/_matrix/" = {
- proxyPass = "http://backend_conduit$request_uri";
- proxyWebsockets = true;
- extraConfig = ''
- proxy_set_header Host $host;
- proxy_buffering off;
- '';
- };
- extraConfig = ''
- merge_slashes off;
- '';
- };
- "${config.services.matrix-conduit.settings.global.server_name}" = {
- forceSSL = true;
- enableACME = true;
- locations."/.well-known/matrix/server/" = {
- alias = "${well_known_server}";
- extraConfig = ''
- default_type application/json;
- '';
- };
- locations."/.well-known/matrix/client/" = {
- alias = "${well_known_client}";
- extraConfig = ''
- default_type application/json;
- add_header Access-Control-Allow-Origin "";
- '';
- };
- };
- };
- upstreams = {
- backend-conduit = {
- servers = {
- "localhost:${builtins.toString config.services.matrix-conduit.settings.global.port}" = {};
- };
- };
- };
- };
- networking.firewall.allowedTCPPorts = [8448];
- networking.firewall.allowedUDPPorts = [8448];
-}