28 lines
		
	
	
	
		
			886 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			886 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   lib,
 | |
|   config,
 | |
|   ...
 | |
| }: {
 | |
|   options.services.flaresolverr = {
 | |
|     subdomain = lib.mkOption {
 | |
|       type = lib.types.nullOr lib.types.str;
 | |
|       default = null;
 | |
|       description = "Subdomain for reverse proxy. If null, service will be local only.";
 | |
|     };
 | |
|     extraSubdomains = lib.mkOption {
 | |
|       type = lib.types.listOf lib.types.str;
 | |
|       default = [];
 | |
|       description = "Extra subdomains for reverse proxy.";
 | |
|     };
 | |
|   };
 | |
| 
 | |
|   config = lib.mkIf (config.services.flaresolverr.enable && config.services.flaresolverr.subdomain != null) {
 | |
|     host.reverse_proxy.subdomains.flaresolverr = {
 | |
|       subdomain = config.services.flaresolverr.subdomain;
 | |
|       extraSubdomains = config.services.flaresolverr.extraSubdomains;
 | |
|       target = "http://127.0.0.1:${toString config.services.flaresolverr.port}";
 | |
|       websockets.enable = true;
 | |
|       forwardHeaders.enable = true;
 | |
|     };
 | |
|   };
 | |
| }
 |