trivionomicon: soju: add soju to the trivionomicon

This commit is contained in:
Fabian Montero 2025-09-13 11:52:18 -06:00
parent eb85e81598
commit 5b9940e041
3 changed files with 76 additions and 0 deletions

47
modules/soju/sys.nix Normal file
View file

@ -0,0 +1,47 @@
{
config,
pkgs,
lib,
cfg,
doctrine,
...
}:
with lib; {
security.acme.certs."${cfg.fullyQualifiedDomain}" = {
reloadServices = ["soju.service"];
group = "soju";
};
networking.firewall.allowedTCPPorts = [cfg.port];
services.soju = let
sojuCertDir = config.security.acme.certs."${cfg.fullyQualifiedDomain}".directory;
in {
enable = true;
hostName = "${cfg.fullyQualifiedDomain}";
listen = ["ircs://[::]:${toString cfg.port}"];
tlsCertificate = "${sojuCertDir}/fullchain.pem";
tlsCertificateKey = "${sojuCertDir}/key.pem";
};
systemd.services.soju = {
after = ["acme-${cfg.fullyQualifiedDomain}.service"];
serviceConfig = {
DynamicUser = mkForce false; # fuck dynamic users
User = "soju";
Group = "soju";
ProtectSystem = "strict";
ProtectHome = "read-only";
PrivateTmp = true;
RemoveIPC = true;
};
};
users = {
users.soju = {
isSystemUser = true;
group = "soju";
};
groups.soju = {};
};
}