Refactor part 2
This commit is contained in:
parent
7b819c69d1
commit
56f3c7e2b0
49 changed files with 385 additions and 358 deletions
|
|
@ -1,38 +1,47 @@
|
|||
{ specialArgs, inputs, config, pkgs, lib, ... }:
|
||||
{ inputs, config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
services.matrix-conduit = {
|
||||
enable = true;
|
||||
extraEnvironment = { RUST_MIN_STACK = "16777216"; };
|
||||
package = pkgs.unstable.matrix-conduit;
|
||||
settings.global = {
|
||||
server_name = "baduhai.me";
|
||||
address = "127.0.0.1";
|
||||
port = 6167;
|
||||
max_request_size = 20000000;
|
||||
allow_registration = true;
|
||||
allow_encryption = false;
|
||||
allow_federation = false;
|
||||
services = {
|
||||
matrix-conduit = {
|
||||
enable = true;
|
||||
extraEnvironment = { RUST_MIN_STACK = "16777216"; };
|
||||
package = pkgs.unstable.matrix-conduit;
|
||||
settings.global = {
|
||||
server_name = "baduhai.me";
|
||||
address = "127.0.0.1";
|
||||
port = 6167;
|
||||
max_request_size = 20000000;
|
||||
allow_registration = true;
|
||||
allow_encryption = false;
|
||||
allow_federation = false;
|
||||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts."matrix.baduhai.me" = {
|
||||
useACMEHost = "baduhai.me";
|
||||
forceSSL = true;
|
||||
kTLS = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:${config.ports.cinny2}";
|
||||
locations."/_matrix/".proxyPass = "http://127.0.0.1:6167$request_uri";
|
||||
locations."= /.well-known/matrix/client" = {
|
||||
alias = pkgs.writeText "matrix-wk-client" ''
|
||||
{ "m.homeserver": { "base_url": "https://matrix.baduhai.me" } }
|
||||
'';
|
||||
extraConfig = "add_header Access-Control-Allow-Origin *;";
|
||||
};
|
||||
locations."= /.well-known/matrix/server" = {
|
||||
alias = pkgs.writeText "matrix-wk-server" ''
|
||||
{ "m.server": "matrix.baduhai.me:443" }
|
||||
'';
|
||||
extraConfig = "add_header Access-Control-Allow-Origin *;";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."matrix.baduhai.me" = {
|
||||
useACMEHost = "baduhai.me";
|
||||
forceSSL = true;
|
||||
kTLS = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:${config.ports.cinny2}";
|
||||
locations."/_matrix/".proxyPass = "http://127.0.0.1:6167$request_uri";
|
||||
locations."= /.well-known/matrix/client" = {
|
||||
alias = pkgs.writeText "matrix-wk-client" ''
|
||||
{ "m.homeserver": { "base_url": "https://matrix.baduhai.me" } }
|
||||
'';
|
||||
extraConfig = "add_header Access-Control-Allow-Origin *;";
|
||||
};
|
||||
locations."= /.well-known/matrix/server" = {
|
||||
alias = pkgs.writeText "matrix-wk-server" ''
|
||||
{ "m.server": "matrix.baduhai.me:443" }
|
||||
'';
|
||||
extraConfig = "add_header Access-Control-Allow-Origin *;";
|
||||
};
|
||||
virtualisation.oci-containers.containers."cinny2" = {
|
||||
image = "ghcr.io/cinnyapp/cinny:latest";
|
||||
ports = [ "${config.ports.cinny2}:80" ];
|
||||
volumes = [ "/data/matrix/cinny-config.json:/app/config.json" ];
|
||||
extraOptions = [ "--pull=always" ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue