style: reformat with nixfmt-rfc-style
This commit is contained in:
parent
5ad8bc1d56
commit
1c5d83d81e
99 changed files with 2247 additions and 1334 deletions
services/matrix
|
@ -15,7 +15,8 @@ let
|
|||
allow_key_sharing = true;
|
||||
delete_keys.delete_outdated_inbound = false;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
# Mautrix-signal settings
|
||||
services.signald.enable = true;
|
||||
systemd.services.matrix-as-signal = {
|
||||
|
|
|
@ -3,14 +3,19 @@
|
|||
let
|
||||
server_name = "felschr.com";
|
||||
domain = "matrix.${server_name}";
|
||||
in {
|
||||
in
|
||||
{
|
||||
services.matrix-conduit = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.matrix-conduit;
|
||||
settings.global = {
|
||||
inherit server_name;
|
||||
database_backend = "rocksdb";
|
||||
trusted_servers = [ "matrix.org" "libera.chat" "nixos.org" ];
|
||||
trusted_servers = [
|
||||
"matrix.org"
|
||||
"libera.chat"
|
||||
"nixos.org"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -18,9 +23,7 @@ in {
|
|||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/_matrix/" = {
|
||||
proxyPass = "http://[::1]:${
|
||||
toString config.services.matrix-conduit.settings.global.port
|
||||
}";
|
||||
proxyPass = "http://[::1]:${toString config.services.matrix-conduit.settings.global.port}";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_buffering off;
|
||||
|
@ -31,23 +34,27 @@ in {
|
|||
services.nginx.virtualHosts.${server_name} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations = let
|
||||
server = { "m.server" = "${domain}:443"; };
|
||||
client = {
|
||||
"m.homeserver"."base_url" = "https://${domain}";
|
||||
"org.matrix.msc3575.proxy"."url" = "https://${domain}";
|
||||
"m.identity_server"."base_url" = "https://vector.im";
|
||||
locations =
|
||||
let
|
||||
server = {
|
||||
"m.server" = "${domain}:443";
|
||||
};
|
||||
client = {
|
||||
"m.homeserver"."base_url" = "https://${domain}";
|
||||
"org.matrix.msc3575.proxy"."url" = "https://${domain}";
|
||||
"m.identity_server"."base_url" = "https://vector.im";
|
||||
};
|
||||
in
|
||||
{
|
||||
"= /.well-known/matrix/server".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
return 200 '${builtins.toJSON server}';
|
||||
'';
|
||||
"= /.well-known/matrix/client".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 '${builtins.toJSON client}';
|
||||
'';
|
||||
};
|
||||
in {
|
||||
"= /.well-known/matrix/server".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
return 200 '${builtins.toJSON server}';
|
||||
'';
|
||||
"= /.well-known/matrix/client".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 '${builtins.toJSON client}';
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [ ./conduit.nix ./element.nix ./appservices.nix ];
|
||||
imports = [
|
||||
./conduit.nix
|
||||
./element.nix
|
||||
./appservices.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ let
|
|||
max_idle_conns = 2;
|
||||
conn_max_lifetime = -1;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
age.secrets.dendrite-private-key = {
|
||||
file = ../../secrets/dendrite/privateKey.age;
|
||||
mode = "755";
|
||||
|
@ -41,19 +42,21 @@ in {
|
|||
"msc2946" # space summaries
|
||||
];
|
||||
|
||||
federation_api.key_perspectives = [{
|
||||
server_name = "matrix.org";
|
||||
keys = [
|
||||
{
|
||||
key_id = "ed25519:auto";
|
||||
public_key = "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw";
|
||||
}
|
||||
{
|
||||
key_id = "ed25519:a_RXGa";
|
||||
public_key = "l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ";
|
||||
}
|
||||
];
|
||||
}];
|
||||
federation_api.key_perspectives = [
|
||||
{
|
||||
server_name = "matrix.org";
|
||||
keys = [
|
||||
{
|
||||
key_id = "ed25519:auto";
|
||||
public_key = "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw";
|
||||
}
|
||||
{
|
||||
key_id = "ed25519:a_RXGa";
|
||||
public_key = "l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
global = {
|
||||
inherit server_name;
|
||||
|
@ -69,10 +72,12 @@ in {
|
|||
};
|
||||
|
||||
services.postgresql = {
|
||||
ensureUsers = [{
|
||||
name = "dendrite";
|
||||
ensureDBOwnership = true;
|
||||
}];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "dendrite";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
ensureDatabases = [ "dendrite" ];
|
||||
};
|
||||
|
||||
|
@ -82,24 +87,28 @@ in {
|
|||
${server_name} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations = let
|
||||
server = { "m.server" = "${domain}:443"; };
|
||||
client = {
|
||||
"m.homeserver"."base_url" = "https://${domain}";
|
||||
"org.matrix.msc3575.proxy"."url" = "https://${domain}";
|
||||
"m.identity_server"."base_url" = "https://vector.im";
|
||||
locations =
|
||||
let
|
||||
server = {
|
||||
"m.server" = "${domain}:443";
|
||||
};
|
||||
client = {
|
||||
"m.homeserver"."base_url" = "https://${domain}";
|
||||
"org.matrix.msc3575.proxy"."url" = "https://${domain}";
|
||||
"m.identity_server"."base_url" = "https://vector.im";
|
||||
};
|
||||
in
|
||||
{
|
||||
"= /.well-known/matrix/server".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
return 200 '${builtins.toJSON server}';
|
||||
'';
|
||||
"= /.well-known/matrix/client".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 '${builtins.toJSON client}';
|
||||
'';
|
||||
};
|
||||
in {
|
||||
"= /.well-known/matrix/server".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
return 200 '${builtins.toJSON server}';
|
||||
'';
|
||||
"= /.well-known/matrix/client".extraConfig = ''
|
||||
add_header Content-Type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 '${builtins.toJSON client}';
|
||||
'';
|
||||
};
|
||||
};
|
||||
"${domain}" = {
|
||||
enableACME = true;
|
||||
|
@ -108,8 +117,7 @@ in {
|
|||
"/".extraConfig = ''
|
||||
return 404;
|
||||
'';
|
||||
"/_matrix".proxyPass =
|
||||
"http://127.0.0.1:${toString config.services.dendrite.httpPort}";
|
||||
"/_matrix".proxyPass = "http://127.0.0.1:${toString config.services.dendrite.httpPort}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
let
|
||||
inherit (config.services.matrix-conduit.settings.global) server_name;
|
||||
matrix_host = "matrix.${server_name}";
|
||||
in {
|
||||
in
|
||||
{
|
||||
services.nginx.virtualHosts."element.felschr.com" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue