feate(nixos) bfs: matrix, element, bla bla bla
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
xrayPort = 10086;
|
xrayPort = 10086;
|
||||||
matrixDomain = "accord.tube";
|
|
||||||
in {
|
in {
|
||||||
# TODO:
|
# TODO:
|
||||||
# white list
|
# white list
|
||||||
@@ -24,6 +23,7 @@ in {
|
|||||||
./voice-tune.nix
|
./voice-tune.nix
|
||||||
./matrix.nix
|
./matrix.nix
|
||||||
./element-rtc.nix
|
./element-rtc.nix
|
||||||
|
./element.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
currentServer = {
|
currentServer = {
|
||||||
|
|||||||
@@ -46,23 +46,23 @@ in {
|
|||||||
default_type application/json;
|
default_type application/json;
|
||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
'';
|
'';
|
||||||
return = "200 '{\
|
return = ''200 '{
|
||||||
\"m.homeserver\": {\
|
"m.homeserver": {
|
||||||
\"base_url\": \"https://${cfg.matrixDomain}\"\
|
"base_url": "https://${cfg.matrixDomain}"
|
||||||
},\
|
},
|
||||||
\"m.identity_server\": {\
|
"m.identity_server": {
|
||||||
\"base_url\": \"https://vector.im\"\
|
"base_url": "https://vector.im"
|
||||||
},\
|
},
|
||||||
\"org.matrix.msc3575.proxy\": {\
|
"org.matrix.msc3575.proxy": {
|
||||||
\"url\": \"https://${cfg.matrixDomain}\"\
|
"url": "https://${cfg.matrixDomain}"
|
||||||
},\
|
},
|
||||||
\"org.matrix.msc4143.rtc_foci\": [\
|
"org.matrix.msc4143.rtc_foci": [
|
||||||
{\
|
{
|
||||||
\"type\": \"livekit\",\
|
"type": "livekit",
|
||||||
\"livekit_service_url\": \"https://${cfg.matrixDomain}/livekit/jwt\"\
|
"livekit_service_url": "https://${cfg.matrixDomain}/livekit/jwt"
|
||||||
}\
|
}
|
||||||
]\
|
]
|
||||||
}'";
|
}' '';
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /livekit/jwt/" = {
|
locations."^~ /livekit/jwt/" = {
|
||||||
@@ -89,7 +89,9 @@ in {
|
|||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
8448
|
8080
|
||||||
|
7880
|
||||||
|
7881
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
22
nixos/system/bfs/element.nix
Normal file
22
nixos/system/bfs/element.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, pkgs, ... }: let
|
||||||
|
cfg = config.currentServer.matrix;
|
||||||
|
in {
|
||||||
|
config = {
|
||||||
|
services.nginx.virtualHosts."element.${cfg.matrixDomain}" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
|
||||||
|
root = pkgs.element-web.override {
|
||||||
|
conf = {
|
||||||
|
default_server_config = {
|
||||||
|
"m.homeserver".base_url = "https://${cfg.matrixDomain}";
|
||||||
|
"m.identity_server".base_url = "https://vector.im";
|
||||||
|
};
|
||||||
|
|
||||||
|
default_theme = "dark";
|
||||||
|
show_labs_settings = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@ in {
|
|||||||
allowedUDPPortRanges = [
|
allowedUDPPortRanges = [
|
||||||
{ from = 49152; to = 65535; }
|
{ from = 49152; to = 65535; }
|
||||||
];
|
];
|
||||||
|
allowedTCPPortRanges = [
|
||||||
|
{ from = 50000; to = 51000; }
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.matrix-synapse.settings = {
|
services.matrix-synapse.settings = {
|
||||||
|
|||||||
Reference in New Issue
Block a user