mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-07-01 21:35:22 +02:00
switch matrix domain
This commit is contained in:
parent
1a219d91b9
commit
8f3e0efe60
1 changed files with 17 additions and 86 deletions
|
@ -1,7 +1,7 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
fqdn = "matrix.missing.ninja";
|
fqdn = "matrix.miau.social";
|
||||||
baseUrl = "https://${fqdn}";
|
baseUrl = "https://${fqdn}";
|
||||||
clientConfig."m.homeserver".base_url = baseUrl;
|
clientConfig."m.homeserver".base_url = baseUrl;
|
||||||
serverConfig."m.server" = "${fqdn}:443";
|
serverConfig."m.server" = "${fqdn}:443";
|
||||||
|
@ -12,31 +12,20 @@ let
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.postgresql.enable = true;
|
|
||||||
services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
|
|
||||||
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
|
|
||||||
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
|
|
||||||
TEMPLATE template0
|
|
||||||
LC_COLLATE = "C"
|
|
||||||
LC_CTYPE = "C";
|
|
||||||
'';
|
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"missing.ninja" = {
|
"miau.social" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
||||||
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
||||||
};
|
};
|
||||||
"matrix.missing.ninja" = {
|
"matrix.miau.social" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".extraConfig = ''
|
locations."/".proxyPass = "http://unix:${config.services.matrix-continuwuity.settings.global.unix_socket_path}";
|
||||||
return 404;
|
|
||||||
'';
|
|
||||||
locations."/_matrix".proxyPass = "http://[::1]:8448";
|
|
||||||
locations."/_synapse/client".proxyPass = "http://[::1]:8448";
|
|
||||||
};
|
};
|
||||||
"element.missing.ninja" = {
|
"element.miau.social" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
root = pkgs.element-web.override {
|
root = pkgs.element-web.override {
|
||||||
|
@ -48,75 +37,17 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.matrix-synapse = {
|
systemd.services.nginx.serviceConfig.ProtectHome = false;
|
||||||
|
|
||||||
|
users.groups.continuwuity.members = [ "nginx" ];
|
||||||
|
|
||||||
|
services.matrix-continuwuity = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings.global = {
|
||||||
server_name = "missing.ninja";
|
unix_socket_path = "/run/continuwuity/continuwuity.sock";
|
||||||
registration_shared_secret = "";
|
server_name = "miau.social";
|
||||||
public_baseurl = baseUrl;
|
registration_token = "NyanNyan";
|
||||||
app_service_config_files = [ "/var/lib/matrix-synapse/whatsapp-registration.yaml" ];
|
allow_registration = true;
|
||||||
listeners = [
|
|
||||||
{
|
|
||||||
port = 8448;
|
|
||||||
bind_addresses = [ "::1" ];
|
|
||||||
type = "http";
|
|
||||||
tls = false;
|
|
||||||
x_forwarded = true;
|
|
||||||
resources = [
|
|
||||||
{
|
|
||||||
names = [
|
|
||||||
"client"
|
|
||||||
"federation"
|
|
||||||
];
|
|
||||||
compress = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mautrix-whatsapp = {
|
|
||||||
enable = false;
|
|
||||||
settings = {
|
|
||||||
appservice = {
|
|
||||||
database = {
|
|
||||||
type = "sqlite3";
|
|
||||||
uri = "/var/lib/mautrix-whatsapp/mautrix-whatsapp.db";
|
|
||||||
};
|
|
||||||
ephemeral_events = true;
|
|
||||||
id = "whatsapp";
|
|
||||||
};
|
|
||||||
bridge = {
|
|
||||||
encryption = {
|
|
||||||
allow = true;
|
|
||||||
default = true;
|
|
||||||
require = false;
|
|
||||||
appservice = true;
|
|
||||||
|
|
||||||
};
|
|
||||||
history_sync = {
|
|
||||||
request_full_sync = true;
|
|
||||||
message_count = -1;
|
|
||||||
};
|
|
||||||
mute_bridging = true;
|
|
||||||
personal_filtering_spaces = true;
|
|
||||||
permissions = {
|
|
||||||
"*" = "relay";
|
|
||||||
"missing.ninja" = "user";
|
|
||||||
"@admin:missing.ninja" = "admin";
|
|
||||||
};
|
|
||||||
private_chat_portal_meta = true;
|
|
||||||
whatsapp_thumbnail = true;
|
|
||||||
federate_rooms = false;
|
|
||||||
caption_in_message = true;
|
|
||||||
extev_polls = true;
|
|
||||||
cross_room_replies = true;
|
|
||||||
|
|
||||||
provisioning = {
|
|
||||||
shared_secret = "disable";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue