diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-06-23 00:30:23 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-06-23 00:30:23 +0200 |
commit | 5a1826585861b32ce2509c0643e793196d81893e (patch) | |
tree | d4dd161ac2fccb34faba9dcfd0d4147fb4ac24aa /modules | |
parent | 41a1bcee250b9bd1ca6f179de8db41e24671ac50 (diff) | |
download | nixlib-5a1826585861b32ce2509c0643e793196d81893e.tar nixlib-5a1826585861b32ce2509c0643e793196d81893e.tar.gz nixlib-5a1826585861b32ce2509c0643e793196d81893e.tar.bz2 nixlib-5a1826585861b32ce2509c0643e793196d81893e.tar.lz nixlib-5a1826585861b32ce2509c0643e793196d81893e.tar.xz nixlib-5a1826585861b32ce2509c0643e793196d81893e.tar.zst nixlib-5a1826585861b32ce2509c0643e793196d81893e.zip |
modules/soju: migrate away from NixOS module
With the next version of soju, we won't be able to override the database, because the module puts a sqlite database in the config file unconditionally, and soju will check for duplicates. We already had to mkForce the DynamicUser setting, so the module is just causing more trouble than it's worth.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/server/irc/soju/default.nix | 30 | ||||
-rw-r--r-- | modules/server/irc/soju/soju.conf | 9 |
2 files changed, 23 insertions, 16 deletions
diff --git a/modules/server/irc/soju/default.nix b/modules/server/irc/soju/default.nix index 0ab8e8ed97b6..3ffa4d9616c7 100644 --- a/modules/server/irc/soju/default.nix +++ b/modules/server/irc/soju/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ pkgs, config, lib, ... }: { networking.firewall.allowedTCPPorts = [ 6698 ]; @@ -12,15 +12,19 @@ } ]; - services.soju.enable = true; - services.soju.hostName = "${config.networking.hostName}.${config.networking.domain}"; - services.soju.extraConfig = '' - db postgres "dbname=soju host=/run/postgresql sslmode=disable" - message-store db - ''; - services.soju.listen = [ - "unix:///run/soju/soju.sock" - ]; + environment.systemPackages = [ pkgs.soju ]; + + systemd.services.soju = { + wantedBy = [ "multi-user.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + serviceConfig.ExecStart = "${pkgs.soju}/bin/soju -config ${./soju.conf}"; + serviceConfig.Group = "soju"; + serviceConfig.Restart = "always"; + serviceConfig.RuntimeDirectory = "soju"; + serviceConfig.UMask = "0007"; + serviceConfig.User = "soju"; + }; services.nginx.streamConfig = '' server { @@ -31,12 +35,6 @@ } ''; - systemd.services.soju.serviceConfig.DynamicUser = lib.mkForce false; - systemd.services.soju.serviceConfig.Group = "soju"; - systemd.services.soju.serviceConfig.RuntimeDirectory = "soju"; - systemd.services.soju.serviceConfig.UMask = "0007"; - systemd.services.soju.serviceConfig.User = "soju"; - users.users.nginx.extraGroups = [ "soju" ]; users.users.soju = { isNormalUser = true; diff --git a/modules/server/irc/soju/soju.conf b/modules/server/irc/soju/soju.conf new file mode 100644 index 000000000000..242a09d506b1 --- /dev/null +++ b/modules/server/irc/soju/soju.conf @@ -0,0 +1,9 @@ +listen unix:///run/soju/soju.sock +listen unix+admin:///run/soju/admin + +log fs /var/lib/soju/logs +http-origin +accept-proxy-ip + +db postgres "dbname=soju host=/run/postgresql sslmode=disable" +message-store db |