1
0
Fork 0

add loglevel to deluge

This commit is contained in:
ibizaman 2023-10-13 21:17:24 -07:00
parent ef4bacdf58
commit ada91bc0aa

View file

@ -75,6 +75,13 @@ in
description = "Location of additional plugins."; description = "Location of additional plugins.";
default = {}; 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 { config = lib.mkIf cfg.enable {
@ -123,6 +130,14 @@ in
web.port = cfg.webPort; 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: systemd.tmpfiles.rules = lib.attrsets.mapAttrsToList (name: path:
"L+ ${config.services.deluge.dataDir}/.config/deluge/plugins/${name} - - - - ${path}" "L+ ${config.services.deluge.dataDir}/.config/deluge/plugins/${name} - - - - ${path}"