forked from jan-leila/nix-config
		
	
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			742 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			742 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   config,
 | |
|   lib,
 | |
|   ...
 | |
| }: {
 | |
|   options.services.paperless = {
 | |
|     subdomain = lib.mkOption {
 | |
|       type = lib.types.str;
 | |
|       description = "subdomain of base domain that paperless will be hosted at";
 | |
|       default = "paperless";
 | |
|     };
 | |
|   };
 | |
| 
 | |
|   config = lib.mkIf (config.services.paperless.enable && config.host.reverse_proxy.enable) {
 | |
|     host = {
 | |
|       reverse_proxy.subdomains.${config.services.paperless.subdomain} = {
 | |
|         target = "http://${config.services.paperless.address}:${toString config.services.paperless.port}";
 | |
| 
 | |
|         websockets.enable = true;
 | |
|         forwardHeaders.enable = true;
 | |
| 
 | |
|         extraConfig = ''
 | |
|           # allow large file uploads
 | |
|           client_max_body_size 50000M;
 | |
|         '';
 | |
|       };
 | |
|     };
 | |
|   };
 | |
| }
 |