configuration.nix/hosts/rico2/services/adtya.xyz.nix

30 lines
755 B
Nix
Raw Normal View History

2023-10-28 04:31:09 +05:30
{
config,
adtya-xyz,
2023-10-28 04:32:52 +05:30
...
2023-10-28 04:31:09 +05:30
}: {
2023-06-02 12:45:51 +05:30
services.caddy.virtualHosts."adtya.xyz" = {
2023-06-02 12:52:48 +05:30
serverAliases = ["www.adtya.xyz"];
2023-06-02 12:45:51 +05:30
extraConfig = ''
2023-06-02 13:35:52 +05:30
handle /.well-known/matrix/server {
2023-06-03 00:43:12 +05:30
header Content-Type application/json
header Access-Control-Allow-Origin *
respond `{"m.server": "matrix.adtya.xyz:443"}`
}
2023-06-02 13:35:52 +05:30
2023-06-03 00:43:12 +05:30
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"}}`
}
2023-10-28 04:31:09 +05:30
handle {
root * ${adtya-xyz.packages.${config.nixpkgs.system}.default}/share/web
encode gzip
try_files {path} /index.html
file_server
}
2023-06-02 12:45:51 +05:30
'';
};
}