From 9634b57b8619c8f675f7374c17d1b8a57d3de1de Mon Sep 17 00:00:00 2001 From: twoneis Date: Fri, 7 Feb 2025 21:16:16 +0100 Subject: [PATCH] init matrix config --- devices/ellaca/options.nix | 1 + modules/default.nix | 1 + modules/matrix/default.nix | 24 ++++++++++++++++++++++++ options.nix | 1 + 4 files changed, 27 insertions(+) create mode 100644 modules/matrix/default.nix diff --git a/devices/ellaca/options.nix b/devices/ellaca/options.nix index b04119d..873a8e4 100644 --- a/devices/ellaca/options.nix +++ b/devices/ellaca/options.nix @@ -4,6 +4,7 @@ nginx.enable = true; website.enable = true; fedi.enable = false; # Currently broken + matrix.enable = true; stateVersion = "25.05"; hmStateVersion = "25.05"; diff --git a/modules/default.nix b/modules/default.nix index e3b891e..0811725 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -9,6 +9,7 @@ in { ./games ./home ./layout + ./matrix ./networking ./nginx ./niri diff --git a/modules/matrix/default.nix b/modules/matrix/default.nix new file mode 100644 index 0000000..93420b3 --- /dev/null +++ b/modules/matrix/default.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: let + inherit (config) conf; + inherit (lib) mkIf; +in mkIf conf.matrix.enable { + services.nginx.virtualHosts = { + "matrix.twoneis.site" = { + serverName = "matrix.twoneis.site"; + forceSSL = false; + locations = { + "/" = { + recommendedProxySettings = true; + proxyPass = "http://127.0.0.1:6167"; + }; + }; + }; + }; + + services.conduwuit = { + enable = true; + settings.global = { + server_name = "matrix.twoneis.site"; + }; + }; +} diff --git a/options.nix b/options.nix index e4d8d8b..f097679 100644 --- a/options.nix +++ b/options.nix @@ -20,6 +20,7 @@ in { nginx.enable = mkEnableOption "Enable nginx."; website.enable = mkEnableOption "Serve website through nginx. Nginx must be enabled to work correctly."; fedi.enable = mkEnableOption "Host a fedi server on this machine."; + matrix.enable = mkEnableOption "Host a matrix server on this machine"; # Mixed and more complex options username = mkOption {