2024-08-11 11:39:58 +00:00
|
|
|
{ config, lib, ... }:
|
2024-08-09 20:45:15 +00:00
|
|
|
|
2024-08-11 12:50:32 +00:00
|
|
|
let
|
2024-08-12 18:51:38 +00:00
|
|
|
svc_domain = config.mine.shared.settings.domain;
|
2024-08-11 12:50:32 +00:00
|
|
|
in {
|
2024-08-09 20:45:15 +00:00
|
|
|
services.murmur = let
|
2024-08-11 12:50:32 +00:00
|
|
|
certLocation = config.security.acme.certs."${svc_domain}".directory;
|
2024-08-09 20:45:15 +00:00
|
|
|
in {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
|
|
|
|
sslCert = certLocation + "/fullchain.pem";
|
|
|
|
sslKey = certLocation + "/key.pem";
|
|
|
|
|
|
|
|
environmentFile = config.age.secrets.murmur-env.path;
|
|
|
|
password = "$MURMUR_PASSWORD";
|
|
|
|
welcometext = "Welcome to Friclouds Mumble server!";
|
|
|
|
};
|
|
|
|
|
2024-08-09 21:07:51 +00:00
|
|
|
# set superpassword on start from secrets
|
|
|
|
systemd.services.murmur.preStart = lib.mkAfter ''${config.services.murmur.package}/bin/mumble-server -ini /run/murmur/murmurd.ini -readsupw < ${config.age.secrets.murmur-superpassword.path}'';
|
|
|
|
|
2024-08-12 21:34:15 +00:00
|
|
|
# automatically reload service
|
|
|
|
security.acme.certs."${svc_domain}".reloadServices = [ config.systemd.services.murmur.name ];
|
|
|
|
|
2024-08-10 15:49:20 +00:00
|
|
|
# add murmur user to domain group to access cert
|
2024-08-11 12:50:32 +00:00
|
|
|
users.groups.main-domain.members = [ config.users.groups.murmur.name ];
|
2024-08-09 20:45:15 +00:00
|
|
|
|
2024-08-13 12:42:32 +00:00
|
|
|
# secrets
|
2024-08-09 20:45:15 +00:00
|
|
|
age.secrets = {
|
|
|
|
murmur-env.owner = config.users.users.murmur.name;
|
2024-08-09 21:07:51 +00:00
|
|
|
murmur-superpassword.owner = config.users.users.murmur.name;
|
2024-08-09 20:45:15 +00:00
|
|
|
};
|
|
|
|
|
2024-08-13 12:42:32 +00:00
|
|
|
# persistence
|
2024-08-09 20:45:15 +00:00
|
|
|
environment.persistence.root.directories = [
|
|
|
|
"/var/lib/murmur"
|
|
|
|
];
|
2024-08-13 12:42:32 +00:00
|
|
|
|
|
|
|
# meta information about the service.
|
|
|
|
mine.shared.meta.murmur = {
|
|
|
|
name = "Mumble";
|
|
|
|
description = "We host our own mumble server at, which you're welcome to join. The password is {{secrets.MURMUR_PASSWORD}}.";
|
2024-08-13 19:19:52 +00:00
|
|
|
url = "mumble://:{{secrets.MURMUR_PASSWORD}}@${svc_domain}";
|
2024-08-13 12:42:32 +00:00
|
|
|
|
|
|
|
secrets.auth = config.age.secrets.murmur-env.path;
|
|
|
|
|
|
|
|
package = let
|
|
|
|
pkg = config.services.murmur.package;
|
|
|
|
in {
|
|
|
|
name = pkg.pname;
|
|
|
|
version = pkg.version;
|
|
|
|
meta = pkg.meta;
|
|
|
|
};
|
|
|
|
};
|
2024-08-09 20:45:15 +00:00
|
|
|
}
|