From 72d16ac9b5550ac11c42e599b27bb2e53a0f07f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Sat, 16 Oct 2021 14:09:43 +0200 Subject: [PATCH] transmission: add extraFlags configuration option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes service more customizeable and makes debuggingin easier through the use of flags like `--log-debug` or `--dump-settings`. Signed-off-by: Jakub SokoĊ‚owski --- nixos/modules/services/torrent/transmission.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index d5c62550ecef..a6ff467914a1 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -214,6 +214,15 @@ in example = "/var/lib/secrets/transmission/settings.json"; }; + extraFlags = mkOption { + type = types.listOf types.str; + default = []; + example = [ "--log-debug" ]; + description = '' + Extra flags passed to the transmission command in the service definition. + ''; + }; + openPeerPorts = mkEnableOption "opening of the peer port(s) in the firewall"; openRPCPort = mkEnableOption "opening of the RPC port in the firewall"; @@ -262,7 +271,7 @@ in install -D -m 600 -o '${cfg.user}' -g '${cfg.group}' /dev/stdin \ '${cfg.home}/${settingsDir}/settings.json' '')]; - ExecStart="${pkgs.transmission}/bin/transmission-daemon -f -g ${cfg.home}/${settingsDir}"; + ExecStart="${pkgs.transmission}/bin/transmission-daemon -f -g ${cfg.home}/${settingsDir} ${escapeShellArgs cfg.extraFlags}"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; User = cfg.user; Group = cfg.group;