From c8b70c52c5b023556a8f0fc9d72d7500be65b1ec Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 25 Jan 2026 18:16:22 +0100 Subject: tweak(tente): stop hosting Matrix I'm unhappy with the UX of Matrix. --- nixos/hosts/tente/default.nix | 8 ----- nixos/hosts/tente/matrix.nix | 60 -------------------------------------- nixos/hosts/tente/ports.nix | 1 - nixos/hosts/tente/web-personal.nix | 34 +++++---------------- 4 files changed, 8 insertions(+), 95 deletions(-) delete mode 100644 nixos/hosts/tente/matrix.nix (limited to 'nixos') diff --git a/nixos/hosts/tente/default.nix b/nixos/hosts/tente/default.nix index fe9b0a5..22afbbe 100644 --- a/nixos/hosts/tente/default.nix +++ b/nixos/hosts/tente/default.nix @@ -28,7 +28,6 @@ in ./git-web.nix ./gitolite.nix ./headscale.nix - ./matrix.nix ./exporters.nix ./grafana.nix "${sources.my-git-grep-exporter}/service.nix" @@ -114,12 +113,6 @@ in port = ports.headscale; }; - matrix = { - serverName = baseDomain; - apiDomain = "matrix.${baseDomain}"; - port = ports.matrix; - }; - # Websites services.nginx = { @@ -155,7 +148,6 @@ in web-personal = { domain = baseDomain; dir = "/srv/www/${baseDomain}/current"; # not managed via Nix - matrixApiDomain = config.matrix.apiDomain; }; gitWeb = { diff --git a/nixos/hosts/tente/matrix.nix b/nixos/hosts/tente/matrix.nix deleted file mode 100644 index 89782fc..0000000 --- a/nixos/hosts/tente/matrix.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: - -let - cfg = config.matrix; - helpers = import { inherit config lib pkgs; }; -in -{ - options.matrix = { - port = lib.mkOption { - type = lib.types.int; - }; - serverName = lib.mkOption { - type = lib.types.str; - }; - apiDomain = lib.mkOption { - type = lib.types.str; - }; - }; - - config = { - services = { - matrix-conduit = { - enable = true; - package = pkgs-unstable.matrix-conduit; - settings = { - global = { - server_name = cfg.serverName; - port = cfg.port; - address = "127.0.0.1"; # this is the default of conduit but the nixos service defaults to ::1 - database_backend = "rocksdb"; - enable_lightning_bolt = false; - allow_registration = false; - }; - }; - }; - - nginx.virtualHosts.${cfg.apiDomain} = { - enableACME = true; - forceSSL = true; - extraConfig = helpers.mkNginxConfig cfg.apiDomain; - - # TODO: add locations."/" with some message - - # Forward all Matrix API calls to the Conduit Matrix homeserver. A trailing slash - # *must not* be used here. - locations."/_matrix".proxyPass = "http://127.0.0.1:${toString cfg.port}"; - }; - - # I don't really care about these nginx access logs. Conduit has its own - # log anyway and with the default log rotation (weekly and delaycompress=true) - # the access logs from last week took up ~800MB. - logrotate.settings.matrix-nginx-access-log = - (helpers.mkNginxAccessLogrotateSettings cfg.apiDomain) - // { - frequency = "daily"; - rotate = 14; - }; - }; - }; -} diff --git a/nixos/hosts/tente/ports.nix b/nixos/hosts/tente/ports.nix index 5fe89eb..426bf13 100644 --- a/nixos/hosts/tente/ports.nix +++ b/nixos/hosts/tente/ports.nix @@ -3,7 +3,6 @@ rec { grafanaAlloy = 3001; grafanaLoki = 3030; headscale = 8080; - matrix = 8008; prometheus = 9090; prometheusNodeExporter = 9002; prometheusSqlExporter = 9003; diff --git a/nixos/hosts/tente/web-personal.nix b/nixos/hosts/tente/web-personal.nix index 093525f..d41356f 100644 --- a/nixos/hosts/tente/web-personal.nix +++ b/nixos/hosts/tente/web-personal.nix @@ -12,38 +12,20 @@ in dir = lib.mkOption { type = lib.types.str; }; - matrixApiDomain = lib.mkOption { - type = lib.types.str; - }; }; config = { services = { - nginx.virtualHosts.${cfg.domain} = - let - mkWellKnown = data: '' - default_type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '${builtins.toJSON data}'; - ''; - in - { - enableACME = true; - forceSSL = true; - root = cfg.dir; - extraConfig = helpers.mkNginxConfig cfg.domain; - - locations."= /.well-known/matrix/server".extraConfig = mkWellKnown { - "m.server" = "${cfg.matrixApiDomain}:443"; - }; - locations."= /.well-known/matrix/client".extraConfig = mkWellKnown { - "m.homeserver" = { base_url = "https://${cfg.matrixApiDomain}"; }; - }; + nginx.virtualHosts.${cfg.domain} = { + enableACME = true; + forceSSL = true; + root = cfg.dir; + extraConfig = helpers.mkNginxConfig cfg.domain; - locations."= /posts/atom.xml" = { - return = "301 /posts.atom"; - }; + locations."= /posts/atom.xml" = { + return = "301 /posts.atom"; }; + }; }; }; } -- cgit v1.3.1