Re-enable personal Matrix home server

This commit is contained in:
Andrea Ciceri 2025-03-06 13:06:24 +01:00
parent 3c12cbec24
commit d5a1912ced
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
3 changed files with 30 additions and 28 deletions

View file

@ -33,6 +33,7 @@
"atticd" "atticd"
"jellyfin" "jellyfin"
"firefly" "firefly"
"matrix"
] ]
++ [ ++ [
./disko.nix ./disko.nix

View file

@ -17,6 +17,7 @@
"jelly.aciceri.dev" "jelly.aciceri.dev"
"firefly.aciceri.dev" "firefly.aciceri.dev"
"import.firefly.aciceri.dev" "import.firefly.aciceri.dev"
"matrix.aciceri.dev"
]; ];
apiTokenFile = config.age.secrets.cloudflare-dyndns-api-token.path; apiTokenFile = config.age.secrets.cloudflare-dyndns-api-token.path;
}; };

View file

@ -7,7 +7,7 @@
let let
clientConfig = { clientConfig = {
"m.homeserver".base_url = "https://matrix.aciceri.dev"; "m.homeserver".base_url = "https://matrix.aciceri.dev";
"org.matrix.msc3575.proxy".url = "https://syncv3.matrix.aciceri.dev"; # "org.matrix.msc3575.proxy".url = "https://syncv3.matrix.aciceri.dev";
}; };
serverConfig."m.server" = "matrix.aciceri.dev:443"; serverConfig."m.server" = "matrix.aciceri.dev:443";
mkWellKnown = data: '' mkWellKnown = data: ''
@ -38,13 +38,13 @@ in
services.postgresql = { services.postgresql = {
enable = true; enable = true;
initialScript = pkgs.writeText "synapse-init.sql" '' # initialScript = pkgs.writeText "synapse-init.sql" ''
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse'; # CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" # CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
TEMPLATE template0 # TEMPLATE template0
LC_COLLATE = "C" # LC_COLLATE = "C"
LC_CTYPE = "C"; # LC_CTYPE = "C";
''; # '';
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
@ -80,27 +80,27 @@ in
extraConfigFiles = [ config.age.secrets.matrix-registration-shared-secret.path ]; extraConfigFiles = [ config.age.secrets.matrix-registration-shared-secret.path ];
}; };
backup.paths = [ # backup.paths = [
config.services.matrix-synapse.dataDir # config.services.matrix-synapse.dataDir
"/var/backup/postgresql/matrix-synapse.sql.gz" # "/var/backup/postgresql/matrix-synapse.sql.gz"
]; # ];
services.postgresqlBackup = { # services.postgresqlBackup = {
enable = true; # enable = true;
databases = [ "matrix-synapse" ]; # databases = [ "matrix-synapse" ];
}; # };
services.matrix-sliding-sync = { # services.matrix-sliding-sync = {
enable = true; # enable = true;
environmentFile = config.age.secrets.matrix-sliding-sync-secret.path; # environmentFile = config.age.secrets.matrix-sliding-sync-secret.path;
settings = { # settings = {
SYNCV3_SERVER = "http://localhost:8008"; # SYNCV3_SERVER = "http://localhost:8008";
}; # };
}; # };
services.nginx.virtualHosts."syncv3.matrix.aciceri.dev" = { # services.nginx.virtualHosts."syncv3.matrix.aciceri.dev" = {
enableACME = true; # enableACME = true;
forceSSL = true; # forceSSL = true;
locations."/".proxyPass = config.services.matrix-sliding-sync.settings.SYNCV3_SERVER; # locations."/".proxyPass = config.services.matrix-sliding-sync.settings.SYNCV3_SERVER;
}; # };
} }