commit 9ac0cc37682c4830f0cc8002b70d768532f91f5f parent 3344813979d014600ee3d4ac2e60dbb55f102f35 Author: MTRNord <mtrnord1@gmail.com> Date: Sat, 6 Apr 2024 21:40:47 +0200 Manually do soju Diffstat:
| M | nixos/worker-2/soju.nix | | | 30 | +++++++++++++++++++++++++++--- |
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/nixos/worker-2/soju.nix b/nixos/worker-2/soju.nix @@ -6,12 +6,12 @@ }: { environment.persistence."/persist" = { directories = [ - #"/var/lib/soju" + "/var/lib/soju" "/var/lib/acme" ]; }; services.soju = { - enable = true; + enable = false; hostName = "soju.midnightthoughts.space"; enableMessageLogging = true; tlsCertificateKey = "/var/lib/acme/soju.midnightthoughts.space/key.pem"; @@ -36,8 +36,32 @@ }; }; }; + environment.etc."soju/config" = { + user = "soju"; + group = "soju"; + text = '' + listen :6697 + hostname soju.midnightthoughts.space + tls /var/lib/acme/soju.midnightthoughts.space/fullchain.pem /var/lib/acme/soju.midnightthoughts.space/key.pem + db sqlite3 /var/lib/soju/soju.db + log fs /var/lib/soju/logs + ''; + }; + + systemd.services.soju = { + description = "soju IRC bouncer"; + wantedBy = ["multi-user.target"]; + wants = ["network-online.target"]; + after = ["network-online.target"]; + serviceConfig = { + Restart = "always"; + ExecStart = "${inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.soju}/bin/soju -config /etc/soju/config"; + StateDirectory = "soju"; + User = "soju"; + Group = "soju"; + }; + }; networking.firewall.allowedTCPPorts = [ 6697 - 1360 ]; }