| 
									
										
										
										
											2022-11-10 20:24:59 +01:00
										 |  |  | # a password-generator using the marokov model | 
					
						
							| 
									
										
										
										
											2023-11-07 22:00:00 +01:00
										 |  |  | { config, lib, ... }: | 
					
						
							| 
									
										
										
										
											2022-11-10 20:24:59 +01:00
										 |  |  | let | 
					
						
							|  |  |  |   cfg = config.my.services.passworts; | 
					
						
							| 
									
										
										
										
											2023-11-07 23:13:51 +01:00
										 |  |  |   inherit (config.networking) domain; | 
					
						
							| 
									
										
										
										
											2022-11-10 20:24:59 +01:00
										 |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.my.services.passworts = with lib; { | 
					
						
							|  |  |  |     enable = mkEnableOption "Navidrome Music Server"; | 
					
						
							|  |  |  |     port = mkOption { | 
					
						
							|  |  |  |       type = types.port; | 
					
						
							|  |  |  |       default = 5010; | 
					
						
							|  |  |  |       example = 8080; | 
					
						
							|  |  |  |       description = "Internal port for webui"; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = lib.mkIf cfg.enable { | 
					
						
							|  |  |  |     services.passworts = { | 
					
						
							|  |  |  |       enable = true; | 
					
						
							|  |  |  |       inherit (cfg) port; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     my.services.nginx.virtualHosts = [ | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         subdomain = "passworts"; | 
					
						
							|  |  |  |         inherit (cfg) port; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     webapps.apps.passworts = { | 
					
						
							|  |  |  |       dashboard = { | 
					
						
							|  |  |  |         name = "Passworts"; | 
					
						
							|  |  |  |         category = "other"; | 
					
						
							|  |  |  |         icon = "lock"; | 
					
						
							| 
									
										
										
										
											2023-11-12 20:39:44 +01:00
										 |  |  |         url = "https://passworts.${domain}"; | 
					
						
							| 
									
										
										
										
											2022-11-10 20:24:59 +01:00
										 |  |  |       }; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |