nixos/modules/services/mumble-server/default.nix

41 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2022-07-30 15:38:22 +02:00
# Have a good quality voice chat
{ config, lib, pkgs, ... }:
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
'';
};
users.groups."voice-buehler-rocks".members = [ "murmur" "nginx" ];
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
};
}