From cc2f7bbea403b06f52ec1bd261a8bd5eb8fca687 Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Thu, 11 Sep 2025 10:53:10 +0200 Subject: [PATCH 1/2] replace nheko with fractal --- homes/x86_64-linux/chris@manwe/default.nix | 2 +- modules/home/application/matrix/default.nix | 15 +++++++++++++++ modules/home/application/nheko/default.nix | 15 --------------- 3 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 modules/home/application/matrix/default.nix delete mode 100644 modules/home/application/nheko/default.nix diff --git a/homes/x86_64-linux/chris@manwe/default.nix b/homes/x86_64-linux/chris@manwe/default.nix index abeb606..9abe613 100644 --- a/homes/x86_64-linux/chris@manwe/default.nix +++ b/homes/x86_64-linux/chris@manwe/default.nix @@ -35,7 +35,7 @@ bitwarden.enable = true; discord.enable = true; ladybird.enable = true; - nheko.enable = true; + matrix.enable = true; obs.enable = true; onlyoffice.enable = true; signal.enable = true; diff --git a/modules/home/application/matrix/default.nix b/modules/home/application/matrix/default.nix new file mode 100644 index 0000000..1a33a0c --- /dev/null +++ b/modules/home/application/matrix/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, namespace, osConfig ? {}, ... }: +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.application.matrix; +in +{ + options.${namespace}.application.matrix = { + enable = mkEnableOption "enable Matrix client (Fractal)"; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ fractal ]; + }; +} diff --git a/modules/home/application/nheko/default.nix b/modules/home/application/nheko/default.nix deleted file mode 100644 index b04b375..0000000 --- a/modules/home/application/nheko/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, pkgs, namespace, osConfig ? {}, ... }: -let - inherit (lib) mkIf mkEnableOption; - - cfg = config.${namespace}.application.nheko; -in -{ - options.${namespace}.application.nheko = { - enable = mkEnableOption "enable nheko (matrix client)"; - }; - - config = mkIf cfg.enable { - home.packages = with pkgs; [ nheko ]; - }; -} From d4eff470499f55c490c7dda2775dda5b53f338ff Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Thu, 11 Sep 2025 10:53:17 +0200 Subject: [PATCH 2/2] finally have a working matrix set up --- .../communication/conduit/default.nix | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/modules/nixos/services/communication/conduit/default.nix b/modules/nixos/services/communication/conduit/default.nix index aa4d5c1..13a2cbc 100644 --- a/modules/nixos/services/communication/conduit/default.nix +++ b/modules/nixos/services/communication/conduit/default.nix @@ -16,17 +16,25 @@ in # virtualisation.podman.enable = true; # }; + networking.firewall.allowedTCPPorts = [ 4001 8448 ]; + services = { matrix-conduit = { enable = true; settings.global = { - address = "::1"; + address = "::"; port = 4001; - database_backend = "rocksdb"; + server_name = "matrix.kruining.eu"; - server_name = "chris-matrix"; + database_backend = "rocksdb"; + # database_path = "/var/lib/matrix-conduit/"; + + allow_check_for_updates = false; + allow_registration = false; + + enable_lightning_bolt = false; }; }; @@ -43,11 +51,25 @@ in caddy = { enable = true; - virtualHosts = { - ${domain}.extraConfig = '' - # import auth-z + virtualHosts = let + inherit (builtins) toJSON; - # reverse_proxy http://127.0.0.1:5002 + server = { + "m.server" = "${domain}:443"; + }; + client = { + "m.homeserver".base_url = "https://${domain}"; + "m.identity_server".base_url = "https://auth.amarth.cloud"; + }; + in { + "${domain}".extraConfig = '' + header /.well-known/matrix/* Content-Type application/json + header /.well-known/matrix/* Access-Control-Allow-Origin * + respond /.well-known/matrix/server `${toJSON server}` + respond /.well-known/matrix/client `${toJSON client}` + + reverse_proxy /_matrix/* http://::1:4001 + # reverse_proxy /_synapse/client/* http://::1:4001 ''; }; };