| 
									
										
										
										
											2022-07-30 15:38:22 +02:00
										 |  |  | # Have a good quality voice chat | 
					
						
							| 
									
										
										
										
											2024-07-28 21:08:02 +02:00
										 |  |  | { | 
					
						
							|  |  |  |   config, | 
					
						
							|  |  |  |   lib, | 
					
						
							|  |  |  |   pkgs, | 
					
						
							|  |  |  |   ... | 
					
						
							|  |  |  | }: | 
					
						
							| 
									
										
										
										
											2022-07-30 15:38:22 +02:00
										 |  |  | let | 
					
						
							|  |  |  |   cfg = config.my.services.mumble-server; | 
					
						
							| 
									
										
										
										
											2022-11-29 18:48:10 +01:00
										 |  |  |   domain = "voice.${config.networking.domain}"; | 
					
						
							| 
									
										
										
										
											2022-07-30 15:38:22 +02:00
										 |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.my.services.mumble-server = { | 
					
						
							|  |  |  |     enable = lib.mkEnableOption "RSS-Bridge service"; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = lib.mkIf cfg.enable { | 
					
						
							|  |  |  |     services.murmur = { | 
					
						
							|  |  |  |       enable = true; | 
					
						
							| 
									
										
										
										
											2023-01-08 00:53:21 +01:00
										 |  |  |       openFirewall = true; | 
					
						
							| 
									
										
										
										
											2022-07-30 15:38:22 +02:00
										 |  |  |       welcometext = "Welcome to the Mumble-Server!"; | 
					
						
							|  |  |  |       sslCert = "/var/lib/acme/${domain}/fullchain.pem"; | 
					
						
							|  |  |  |       sslKey = "/var/lib/acme/${domain}/key.pem"; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     services.nginx.virtualHosts.${domain}.enableACME = true; | 
					
						
							|  |  |  |     security.acme.certs."${domain}" = { | 
					
						
							|  |  |  |       group = "voice-buehler-rocks"; | 
					
						
							|  |  |  |       postRun = ''
 | 
					
						
							|  |  |  |         if ${pkgs.systemd}/bin/systemctl is-active murmur.service; then | 
					
						
							|  |  |  |           ${pkgs.systemd}/bin/systemctl kill -s SIGUSR1 murmur.service | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  |       '';
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-28 21:08:02 +02:00
										 |  |  |     users.groups."voice-buehler-rocks".members = [ | 
					
						
							|  |  |  |       "murmur" | 
					
						
							|  |  |  |       "nginx" | 
					
						
							|  |  |  |     ]; | 
					
						
							| 
									
										
										
										
											2023-06-19 21:58:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     my.services.prometheus.rules = { | 
					
						
							|  |  |  |       mumble_not_running = { | 
					
						
							|  |  |  |         condition = ''systemd_unit_state{name="murmur.service", state!="active"} > 0''; | 
					
						
							|  |  |  |         description = "{{$labels.host}} should have a running {{$labels.name}}"; | 
					
						
							|  |  |  |       }; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-07-30 15:38:22 +02:00
										 |  |  |   }; | 
					
						
							|  |  |  | } |