| 
									
										
										
										
											2023-06-04 17:17:35 +02:00
										 |  |  | # running dyndns updates | 
					
						
							| 
									
										
										
										
											2023-11-07 22:00:00 +01:00
										 |  |  | { config, lib, ... }: | 
					
						
							| 
									
										
										
										
											2023-06-04 17:17:35 +02:00
										 |  |  | let | 
					
						
							|  |  |  |   cfg = config.my.services.dyndns; | 
					
						
							| 
									
										
										
										
											2023-11-07 23:13:51 +01:00
										 |  |  |   inherit (config.networking) domain; | 
					
						
							| 
									
										
										
										
											2023-06-04 17:17:35 +02:00
										 |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.my.services.dyndns = with lib; { | 
					
						
							|  |  |  |     enable = mkEnableOption "Dyndns"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     username = mkOption { | 
					
						
							|  |  |  |       type = types.str; | 
					
						
							|  |  |  |       description = "Username for the dyndns."; | 
					
						
							|  |  |  |       example = "admin"; | 
					
						
							|  |  |  |       default = "Stunkymonkey-dyndns"; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     passwordFile = mkOption { | 
					
						
							|  |  |  |       type = types.path; | 
					
						
							|  |  |  |       description = "Password for the username for dyndns."; | 
					
						
							|  |  |  |       example = "/run/secrets/freshrss"; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = lib.mkIf cfg.enable { | 
					
						
							| 
									
										
										
										
											2024-10-22 23:04:59 +02:00
										 |  |  |     services.inadyn = { | 
					
						
							| 
									
										
										
										
											2023-06-04 17:17:35 +02:00
										 |  |  |       enable = true; | 
					
						
							| 
									
										
										
										
											2024-10-22 23:04:59 +02:00
										 |  |  |       settings.provider = { | 
					
						
							|  |  |  |         "default@inwx.com" = { | 
					
						
							|  |  |  |           inherit (cfg) username; | 
					
						
							|  |  |  |           include = cfg.passwordFile; | 
					
						
							|  |  |  |           hostname = "serverle.${domain}"; | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2023-06-04 17:17:35 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |