From 3238beab0a32b29eda2a63bf56e67df6e8a1f632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 30 Dec 2019 16:02:36 +0100 Subject: [PATCH] nixos/transmission: fix from where service loads config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently if you specify home to be someplace else than ~/ for user then Transmissions always attempts to load the config from the default location which is $HOME/.config/transmission-daemon based on documentation: https://github.com/transmission/transmission/wiki/Configuration-Files Which means that the changes done to the config under settingsDir in ExecPreStart have no effect because they are modifying a file that is never loaded. I've added an explicit --config-dir ${settingsDir} to make sure that Transmission loads the correct config file even when home is changed. Signed-off-by: Jakub SokoĊ‚owski --- nixos/modules/services/torrent/transmission.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index f7a88867b61..aa1acdf7d20 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -118,7 +118,7 @@ in # 1) Only the "transmission" user and group have access to torrents. # 2) Optionally update/force specific fields into the configuration file. serviceConfig.ExecStartPre = preStart; - serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port}"; + serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port} --config-dir ${settingsDir}"; serviceConfig.ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; serviceConfig.User = cfg.user; serviceConfig.Group = cfg.group;