From 50ced2d2571581117bba273c888cebdcc423eee6 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-2311.section.md | 2 ++ nixos/modules/services/networking/soju.nix | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index cbea6ca000a3bdb..021f5dc7a174fae 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -376,6 +376,8 @@ The module update takes care of the new config syntax and the data itself (user - `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 includes a wrapper for the `sojuctl` command, pointed at the service config file. + ## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals} diff --git a/nixos/modules/services/networking/soju.nix b/nixos/modules/services/networking/soju.nix index a44ee6a1cb0e63e..72295dd87c1eb3b 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 ${pkgs.soju}/bin/sojuctl --config ${configFile} "$@" + ''; in { ###### interface @@ -118,6 +122,8 @@ in } ]; + environment.systemPackages = [ sojuctl ]; + systemd.services.soju = { description = "soju IRC bouncer"; wantedBy = [ "multi-user.target" ];