| 
									
										
										
										
											2022-12-25 12:07:38 +01:00
										 |  |  | # self-hosted recipe manager | 
					
						
							|  |  |  | { config, lib, ... }: | 
					
						
							|  |  |  | let | 
					
						
							|  |  |  |   cfg = config.my.services.tandoor-recipes; | 
					
						
							| 
									
										
										
										
											2023-11-07 23:13:51 +01:00
										 |  |  |   inherit (config.networking) domain; | 
					
						
							| 
									
										
										
										
											2022-12-25 12:07:38 +01:00
										 |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.my.services.tandoor-recipes = with lib; { | 
					
						
							|  |  |  |     enable = mkEnableOption "Tandoor Recipes"; | 
					
						
							|  |  |  |     port = mkOption { | 
					
						
							|  |  |  |       type = types.port; | 
					
						
							|  |  |  |       default = 8089; | 
					
						
							|  |  |  |       example = 8080; | 
					
						
							|  |  |  |       description = "Internal port"; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = lib.mkIf cfg.enable { | 
					
						
							|  |  |  |     services.tandoor-recipes = { | 
					
						
							|  |  |  |       enable = true; | 
					
						
							| 
									
										
										
										
											2023-11-07 23:13:51 +01:00
										 |  |  |       inherit (cfg) port; | 
					
						
							| 
									
										
										
										
											2022-12-25 12:07:38 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Proxy to Tandoor-Recipes | 
					
						
							|  |  |  |     my.services.nginx.virtualHosts = [ | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         subdomain = "recipes"; | 
					
						
							|  |  |  |         inherit (cfg) port; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     webapps.apps.tandoor-recipes = { | 
					
						
							|  |  |  |       dashboard = { | 
					
						
							|  |  |  |         name = "Recipes"; | 
					
						
							|  |  |  |         category = "app"; | 
					
						
							|  |  |  |         icon = "utensils"; | 
					
						
							| 
									
										
										
										
											2023-11-12 20:39:44 +01:00
										 |  |  |         url = "https://recipes.${domain}"; | 
					
						
							| 
									
										
										
										
											2022-12-25 12:07:38 +01:00
										 |  |  |       }; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |