This is a quick hack to make it possible to view the rendered SVG on https://code.tvl.fyi/about/tvix/docs/components.md We want to be able to do this sort of thing dynamically in the future, but we can't yet, so ... well. Deal with it. Change-Id: Id2b819679d748b6f517018a9c6e72d5c1d806c4c Reviewed-on: https://cl.tvl.fyi/c/depot/+/2743 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			808 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			808 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| { config, ... }:
 | |
| 
 | |
| {
 | |
|   imports = [
 | |
|     ./base.nix
 | |
|   ];
 | |
| 
 | |
|   config = {
 | |
|     services.nginx.virtualHosts.cgit = {
 | |
|       serverName = "code.tvl.fyi";
 | |
|       enableACME = true;
 | |
|       forceSSL = true;
 | |
| 
 | |
|       extraConfig = ''
 | |
|         # 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;
 | |
|         }
 | |
| 
 | |
|         # 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/;
 | |
|         }
 | |
|       '';
 | |
|     };
 | |
|   };
 | |
| }
 |