feat: refactored reverse proxy to be a normally named module
This commit is contained in:
		
							parent
							
								
									466926b919
								
							
						
					
					
						commit
						4dd285c122
					
				
					 29 changed files with 352 additions and 426 deletions
				
			
		|  | @ -4,17 +4,26 @@ | |||
|   ... | ||||
| }: { | ||||
|   options.services.actual = { | ||||
|     subdomain = lib.mkOption { | ||||
|     domain = lib.mkOption { | ||||
|       type = lib.types.str; | ||||
|       default = "actual"; | ||||
|       description = "subdomain of base domain that actual will be hosted at"; | ||||
|       description = "domain that actual will be hosted at"; | ||||
|       default = "actual.arpa"; | ||||
|     }; | ||||
|     extraDomains = lib.mkOption { | ||||
|       type = lib.types.listOf lib.types.str; | ||||
|       description = "extra domains that should be configured for actual"; | ||||
|       default = []; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf (config.services.actual.enable && config.host.reverse_proxy.enable) { | ||||
|     host = { | ||||
|       reverse_proxy.subdomains.${config.services.actual.subdomain} = { | ||||
|         target = "http://localhost:${toString config.services.actual.settings.port}"; | ||||
|   config = lib.mkIf (config.services.actual.enable && config.services.reverseProxy.enable) { | ||||
|     services.reverseProxy.services.actual = { | ||||
|       target = "http://localhost:${toString config.services.actual.settings.port}"; | ||||
|       domain = config.services.actual.domain; | ||||
|       extraDomains = config.services.actual.extraDomains; | ||||
| 
 | ||||
|       settings = { | ||||
|         forwardHeaders.enable = true; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue