1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-29 19:17:45 +00:00

Start working on Matrix config

This commit is contained in:
RGBCube 2024-01-17 18:56:37 +03:00
parent 69a8cbb049
commit 493e1052aa
No known key found for this signature in database

30
hosts/cube/matrix.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, ulib, ... }: with ulib;
# Documenting this because I found the way Matrix works a bit weird:
#
# Since it uses normal plain HTTP on ports 80 and 443, we are using
# the root domain and proxying ${domain}/_matrix to the local matrix
# instance that is running. This means there are no matrix or chat
# or whatever 3rd level domains in this setup. The server url is
# the root, everywhere.
let
inherit (config.networking) domain;
in serverSystemConfiguration {
age.secrets."cube/password.matrix".owner = "matrix";
age.secrets."cube/password.matrix.sync".owner = "matrix";
services.postgresql = {
ensureDatabases = [ "matrix" ];
ensureUsers = [{
name = "matrix";
ensureDBOwnership = true;
}];
};
services.matrix-synapse = { # enabled {
settings = {
server_name = domain;
};
};
}