feat: massive refactoring...

This commit is contained in:
Xavier Morel
2025-11-09 00:45:00 +01:00
parent f9446df46d
commit 3245b6b89f
77 changed files with 3233 additions and 582 deletions

63
config/matrix-nginx.nix Normal file
View File

@@ -0,0 +1,63 @@
{
config,
tools,
pkgs,
...
}:
let
json = pkgs.formats.json { };
in
{
environment = {
systemPackages = [
pkgs.element-web
pkgs.synapse-admin-etkecc
];
etc."alloy/logs-nginx.alloy".text =
(import ./alloy/default-journal-logger.alloy.nix {
inherit tools;
container = "matrix";
service = "nginx";
}).out;
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
virtualHosts.element-web = {
root = pkgs.element-web;
locations = {
"/" = {
tryFiles = "$uri $uri/ /index.html?$query_string";
index = "index.html";
};
"= /config.json" = {
alias = json.generate "element.config.json" (
import ./config/matrix-element.config.nix { inherit tools config; }
);
};
};
};
virtualHosts.synapse-admin = {
root = pkgs.synapse-admin-etkecc;
listen = [
{
addr = "0.0.0.0";
port = 5173;
}
];
locations = {
"/" = {
tryFiles = "$uri $uri/ /index.html?$query_string";
index = "index.html";
};
"= /config.json" = {
alias = json.generate "synapse-admin.config.json" (
import ./config/matrix-synapse-admin.config.nix { inherit tools config; }
);
};
};
};
};
}