From 42c0ce2a51035e433153b0f51327ef05298018a3 Mon Sep 17 00:00:00 2001 From: kingfirewxm <50804009+kingfirewxm@users.noreply.github.com> Date: Wed, 15 Apr 2026 13:47:01 +0800 Subject: [PATCH] nixos/sillytavern: respect cfg.package option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module declares `services.sillytavern.package` via `mkPackageOption` but the implementation hardcodes `pkgs.sillytavern` in three places (the `configFile` default, `ExecStart`, and `BindPaths`) and never reads `cfg.package`. As a result, setting the option has no effect — the service always runs whatever `pkgs.sillytavern` resolves to at module evaluation time. Replace the hardcoded references with `cfg.package` and update the corresponding `defaultText` so the rendered documentation matches. --- nixos/modules/services/web-apps/sillytavern.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/web-apps/sillytavern.nix b/nixos/modules/services/web-apps/sillytavern.nix index 6182ca7b1985..4108a6eb3ae8 100644 --- a/nixos/modules/services/web-apps/sillytavern.nix +++ b/nixos/modules/services/web-apps/sillytavern.nix @@ -39,8 +39,8 @@ in configFile = lib.mkOption { type = lib.types.path; - default = "${pkgs.sillytavern}/lib/node_modules/sillytavern/config.yaml"; - defaultText = lib.literalExpression "\${pkgs.sillytavern}/lib/node_modules/sillytavern/config.yaml"; + default = "${cfg.package}/lib/node_modules/sillytavern/config.yaml"; + defaultText = lib.literalExpression "\${cfg.package}/lib/node_modules/sillytavern/config.yaml"; description = '' Path to the SillyTavern configuration file. ''; @@ -109,7 +109,7 @@ in in lib.concatStringsSep " " ( [ - "${lib.getExe pkgs.sillytavern}" + "${lib.getExe cfg.package}" ] ++ f cfg.port "port" ++ f cfg.listen "listen" @@ -122,7 +122,7 @@ in Restart = "always"; StateDirectory = "SillyTavern"; BindPaths = [ - "%S/SillyTavern/extensions:${pkgs.sillytavern}/lib/node_modules/sillytavern/public/scripts/extensions/third-party" + "%S/SillyTavern/extensions:${cfg.package}/lib/node_modules/sillytavern/public/scripts/extensions/third-party" ]; # Security hardening