From d772ac182f949c6290b95b7ac6cd24265598d961 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Sun, 1 Oct 2023 17:36:26 -0700 Subject: [PATCH] nixos/soju: add sojuctl wrapper with config path The config is a in an arbitrary nix store path, and is necessary to invoke sojuctl. Without the wrapper, you have to read the systemd unit or use a similar trick to find it. --- nixos/doc/manual/release-notes/rl-2405.section.md | 2 +- nixos/modules/services/networking/soju.nix | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index b42acbfebaa2..6038bf997d8b 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -485,7 +485,7 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - The `krb5` module has been rewritten and moved to `security.krb5`, moving all options but `security.krb5.enable` and `security.krb5.package` into `security.krb5.settings`. -- `services.soju` now has the option `adminSocket.enable`. This option defaults to `true`, and creates a unix admin socket at `/run/soju/admin`. +- `services.soju` now has a wrapper for the `sojuctl` command, pointed at the service config file. It also has the new option `adminSocket.enable`, which creates a unix admin socket at `/run/soju/admin`. - Gitea 1.21 upgrade has several breaking changes, including: - Custom themes and other assets that were previously stored in `custom/public/*` now belong in `custom/public/assets/*` diff --git a/nixos/modules/services/networking/soju.nix b/nixos/modules/services/networking/soju.nix index f3a7dc1eea01..810957be65f5 100644 --- a/nixos/modules/services/networking/soju.nix +++ b/nixos/modules/services/networking/soju.nix @@ -25,6 +25,10 @@ let ${cfg.extraConfig} ''; + + sojuctl = pkgs.writeShellScriptBin "sojuctl" '' + exec ${cfg.package}/bin/sojuctl --config ${configFile} "$@" + ''; in { ###### interface @@ -120,6 +124,8 @@ in } ]; + environment.systemPackages = [ sojuctl ]; + systemd.services.soju = { description = "soju IRC bouncer"; wantedBy = [ "multi-user.target" ];