2020-07-12 15:02:50 +02:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./base.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
config = {
|
|
|
|
services.nginx.virtualHosts.cgit = {
|
|
|
|
serverName = "code.tvl.fyi";
|
2021-04-02 12:52:55 +02:00
|
|
|
serverAliases = [ "code.tvl.su" ];
|
2020-07-12 15:02:50 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
2021-04-01 00:49:21 +02:00
|
|
|
# Serve the rendered Tvix component SVG.
|
|
|
|
#
|
|
|
|
# TODO(tazjin): Implement a way of serving this dynamically
|
|
|
|
location = /about/tvix/docs/component-flow.svg {
|
|
|
|
alias ${config.depot.tvix.docs.svg}/component-flow.svg;
|
|
|
|
}
|
|
|
|
|
2020-07-12 15:02:50 +02:00
|
|
|
# Static assets must always hit the root.
|
|
|
|
location ~ ^/(favicon\.ico|cgit\.(css|png))$ {
|
|
|
|
proxy_pass http://localhost:2448;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Everything else hits the depot directly.
|
|
|
|
location / {
|
|
|
|
proxy_pass http://localhost:2448/cgit.cgi/depot/;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|