forked from jan-leila/nix-config
		
	added ollama to defiant
This commit is contained in:
		
							parent
							
								
									5cc41542e1
								
							
						
					
					
						commit
						7b6344b419
					
				
					 3 changed files with 32 additions and 2 deletions
				
			
		|  | @ -3,6 +3,10 @@ | |||
|   lib, | ||||
|   ... | ||||
| }: { | ||||
|   options = { | ||||
|     services.ollama.exposePort = lib.mkEnableOption "should we expose ollama on tailscale"; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkMerge [ | ||||
|     { | ||||
|       services.ollama = { | ||||
|  | @ -22,6 +26,15 @@ | |||
|           } | ||||
|         ]; | ||||
|       }; | ||||
|       networking.firewall.interfaces.${config.services.tailscale.interfaceName} = let | ||||
|         ports = [ | ||||
|           config.services.ollama.port | ||||
|         ]; | ||||
|       in | ||||
|         lib.mkIf config.services.ollama.exposePort { | ||||
|           allowedTCPPorts = ports; | ||||
|           allowedUDPPorts = ports; | ||||
|         }; | ||||
|     })) | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue