From cee27b81c9d202cffc0c16cf749686ba8f5e0002 Mon Sep 17 00:00:00 2001 From: DerGrumpf Date: Sat, 11 Apr 2026 00:28:13 +0200 Subject: [PATCH] Added Matrix/Synapse alongside cinny --- home/packages.nix | 1 + hosts/cyper-node-1/configuration.nix | 1 + nixos/roles/matrix.nix | 53 ++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 nixos/roles/matrix.nix diff --git a/home/packages.nix b/home/packages.nix index 73c64c0..8fb3955 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -64,6 +64,7 @@ xonotic irssi blender + cinny-desktop ] ++ lib.optionals pkgs.stdenv.isDarwin [ graphite-cli ]; }; diff --git a/hosts/cyper-node-1/configuration.nix b/hosts/cyper-node-1/configuration.nix index e5e8913..7e19056 100644 --- a/hosts/cyper-node-1/configuration.nix +++ b/hosts/cyper-node-1/configuration.nix @@ -2,6 +2,7 @@ imports = [ ./hardware-configuration.nix ../../nixos/roles/monitoring.nix + ../../nixos/roles/matrix.nix ]; networking = { diff --git a/nixos/roles/matrix.nix b/nixos/roles/matrix.nix new file mode 100644 index 0000000..00ab6c3 --- /dev/null +++ b/nixos/roles/matrix.nix @@ -0,0 +1,53 @@ +{ pkgs, ... }: +{ + networking.firewall.allowedTCPPorts = [ 8448 ]; + + services = { + matrix-synapse = { + enable = true; + settings = { + server_name = "cyperpunk.de"; + public_baseurl = "http://matrix.cyperpunk.de"; + listeners = [ + { + port = 8008; + bind_addresses = [ "127.0.0.1" ]; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { + names = [ + "client" + "federation" + ]; + compress = false; + } + ]; + } + ]; + }; + }; + + nginx = { + enable = true; + virtualHosts = { + "matrix.cyperpunk.de" = { + locations."/" = { + proxyPass = "http://127.0.0.1:8008"; + proxyWebsockets = true; + extraConfig = '' + proxy_set_header Host matrix.cyperpunk.de; + ''; + }; + }; + "cinny.cyperpunk.de" = { + locations."/" = { + root = pkgs.cinny; + tryFiles = "$uri $uri/ /index.html"; + }; + }; + }; + }; + }; +}