64 lines
1.5 KiB
Nix
64 lines
1.5 KiB
Nix
{
|
|
pkgs,
|
|
www,
|
|
secrets,
|
|
...
|
|
}: let
|
|
system = pkgs.system;
|
|
in {
|
|
services = {
|
|
caddy.virtualHosts."adtya.xyz" = {
|
|
serverAliases = ["www.adtya.xyz"];
|
|
extraConfig = ''
|
|
handle /.well-known/matrix/server {
|
|
header Content-Type application/json
|
|
header Access-Control-Allow-Origin *
|
|
respond `{"m.server": "matrix.adtya.xyz:443"}`
|
|
}
|
|
|
|
handle /.well-known/matrix/client {
|
|
header Content-Type application/json
|
|
header Access-Control-Allow-Origin *
|
|
respond `{"m.homeserver": {"base_url": "https://matrix.adtya.xyz:443"}}`
|
|
}
|
|
|
|
handle /.well-known/discord {
|
|
header Access-Control-Allow-Origin *
|
|
respond `${secrets.discord_domain_well_known}`
|
|
}
|
|
|
|
handle {
|
|
root * ${www.packages.${system}.default}/share/web
|
|
encode gzip
|
|
try_files {path} /index.html
|
|
file_server
|
|
}
|
|
'';
|
|
};
|
|
frp.settings = {
|
|
"http.adtya.xyz" = {
|
|
type = "http";
|
|
custom_domains = "adtya.xyz";
|
|
local_port = 80;
|
|
};
|
|
|
|
"https.adtya.xyz" = {
|
|
type = "https";
|
|
custom_domains = "adtya.xyz";
|
|
local_port = 443;
|
|
};
|
|
|
|
"http.www.adtya.xyz" = {
|
|
type = "http";
|
|
custom_domains = "www.adtya.xyz";
|
|
local_port = 80;
|
|
};
|
|
|
|
"https.www.adtya.xyz" = {
|
|
type = "https";
|
|
custom_domains = "www.adtya.xyz";
|
|
local_port = 443;
|
|
};
|
|
};
|
|
};
|
|
}
|