conduit: Add new conduit service
This commit is contained in:
		
							parent
							
								
									3e13b575b0
								
							
						
					
					
						commit
						c56de6cf7e
					
				
					 5 changed files with 94 additions and 2 deletions
				
			
		
							
								
								
									
										53
									
								
								configuration/services/conduit.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								configuration/services/conduit.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,53 @@ | |||
| {config, ...}: let | ||||
|   cfg = config.services.matrix-conduit; | ||||
|   domain = "matrix.${config.services.nginx.domain}"; | ||||
| in { | ||||
|   services.matrix-conduit = { | ||||
|     enable = true; | ||||
|     settings.global = { | ||||
|       address = "127.0.0.1"; | ||||
|       server_name = domain; | ||||
|       database_backend = "rocksdb"; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   services.nginx.virtualHosts."${domain}" = { | ||||
|     enableACME = true; | ||||
| 
 | ||||
|     listen = [ | ||||
|       { | ||||
|         addr = "0.0.0.0"; | ||||
|         port = 443; | ||||
|         ssl = true; | ||||
|       } | ||||
|       { | ||||
|         addr = "[::0]"; | ||||
|         port = 443; | ||||
|         ssl = true; | ||||
|       } | ||||
|       { | ||||
|         addr = "0.0.0.0"; | ||||
|         port = 8448; | ||||
|         ssl = true; | ||||
|       } | ||||
|       { | ||||
|         addr = "[::0]"; | ||||
|         port = 8488; | ||||
|         ssl = true; | ||||
|       } | ||||
|     ]; | ||||
| 
 | ||||
|     addSSL = true; | ||||
|     extraConfig = '' | ||||
|       merge_slashes off; | ||||
|     ''; | ||||
| 
 | ||||
|     locations."/_matrix" = { | ||||
|       proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}"; | ||||
|       # Recommended by conduit | ||||
|       extraConfig = '' | ||||
|         proxy_buffering off; | ||||
|       ''; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue