From ada91bc0aa68a23195120cb7ff67026fcbc9155c Mon Sep 17 00:00:00 2001 From: ibizaman Date: Fri, 13 Oct 2023 21:17:24 -0700 Subject: [PATCH] add loglevel to deluge --- modules/deluge.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/deluge.nix b/modules/deluge.nix index 64cb514..2dff1b3 100644 --- a/modules/deluge.nix +++ b/modules/deluge.nix @@ -75,6 +75,13 @@ in description = "Location of additional plugins."; default = {}; }; + + logLevel = lib.mkOption { + type = lib.types.nullOr (lib.types.enum ["critical" "error" "warning" "info" "debug"]); + description = "Enable logging."; + default = false; + example = true; + }; }; config = lib.mkIf cfg.enable { @@ -123,6 +130,14 @@ in web.port = cfg.webPort; }; + systemd.services.deluged.serviceConfig.ExecStart = lib.mkForce ( + '' + ${config.services.deluge.package}/bin/deluged \ + --do-not-daemonize \ + --config ${config.services.deluge.dataDir}/.config/deluge + '' + + (if (isNull cfg.logLevel) then "" else " -L ${cfg.logLevel}") + ); systemd.tmpfiles.rules = lib.attrsets.mapAttrsToList (name: path: "L+ ${config.services.deluge.dataDir}/.config/deluge/plugins/${name} - - - - ${path}"