Migrated to NixOS (Oh Happy day!!)

This commit is contained in:
2026-04-14 14:46:35 +02:00
parent b3ac11ef38
commit 77ba1cab5f
11 changed files with 196 additions and 129 deletions

View File

@@ -6,8 +6,8 @@ let
in
{
networking.firewall.allowedTCPPorts = [
8008
8448
8080
];
sops.secrets = {
@@ -18,74 +18,35 @@ in
};
};
services = {
matrix-synapse = {
enable = true;
settings = {
server_name = "cyperpunk.de";
public_baseurl = "http://matrix.cyperpunk.de";
enable_registration = false; # TODO: disable
enable_registration_without_verfication = true;
trusted_key_servers = [ { server_name = "matrix.org"; } ];
suppress_key_server_warning = true;
registration_shared_secret_path = config.sops.secrets.matrix_registration_secret.path;
macaroon_secret_key = "$__file{${config.sops.secrets.matrix_macaroon_secret.path}}";
listeners = [
{
port = 8008;
bind_addresses = [ "127.0.0.1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [
"client"
"federation"
];
compress = false;
}
];
}
];
};
};
nginx = {
enable = true;
virtualHosts = {
"matrix.cyperpunk.de" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString (builtins.elemAt config.services.matrix-synapse.settings.listeners 0).port}";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header Host matrix.cyperpunk.de;
'';
};
};
"cinny" = {
listen = [
services.matrix-synapse = {
enable = true;
settings = {
server_name = "cyperpunk.de";
public_baseurl = "http://matrix.cyperpunk.de";
enable_registration = false; # TODO: disable
enable_registration_without_verfication = true;
trusted_key_servers = [ { server_name = "matrix.org"; } ];
suppress_key_server_warning = true;
registration_shared_secret_path = config.sops.secrets.matrix_registration_secret.path;
macaroon_secret_key = "$__file{${config.sops.secrets.matrix_macaroon_secret.path}}";
listeners = [
{
port = 8008;
bind_addresses = [ "0.0.0.0" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
addr = "0.0.0.0";
port = 8080;
names = [
"client"
"federation"
];
compress = false;
}
];
locations."/" = {
alias = "${pkgs.cinny}/";
extraConfig = ''
try_files $uri $uri/ /index.html;
'';
};
};
"${serverIP}" = {
locations = {
"/_matrix/" = {
proxyPass = "http://127.0.0.1:${toString (builtins.elemAt config.services.matrix-synapse.settings.listeners 0).port}";
proxyWebsockets = true;
};
};
};
};
}
];
};
};
}