diff options
author | Luca Bruno <lethalman88@gmail.com> | 2015-11-25 21:31:09 +0100 |
---|---|---|
committer | Luca Bruno <lethalman88@gmail.com> | 2015-11-25 21:37:30 +0100 |
commit | a41292792498e03024d682d092947c2153290073 (patch) | |
tree | b937402b60ea79cfa0e5562dad3268127a491d81 /nixos/modules/services/torrent | |
parent | 8a664fd5bc6b170bdf809030de6871fd6a454f5a (diff) | |
parent | b34a6c96ee14518b82648c5a8c1b29225c15d9df (diff) | |
download | nixlib-a41292792498e03024d682d092947c2153290073.tar nixlib-a41292792498e03024d682d092947c2153290073.tar.gz nixlib-a41292792498e03024d682d092947c2153290073.tar.bz2 nixlib-a41292792498e03024d682d092947c2153290073.tar.lz nixlib-a41292792498e03024d682d092947c2153290073.tar.xz nixlib-a41292792498e03024d682d092947c2153290073.tar.zst nixlib-a41292792498e03024d682d092947c2153290073.zip |
Merge remote-tracking branch 'origin/master' into closure-size
Diffstat (limited to 'nixos/modules/services/torrent')
-rw-r--r-- | nixos/modules/services/torrent/transmission.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index c8fc08570408..5822fb111b82 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -9,7 +9,7 @@ let homeDir = "/var/lib/transmission"; downloadDir = "${homeDir}/Downloads"; incompleteDir = "${homeDir}/.incomplete"; - + settingsDir = "${homeDir}/.config/transmission-daemon"; settingsFile = pkgs.writeText "settings.json" (builtins.toJSON fullSettings); @@ -21,7 +21,7 @@ let else toString ''"${x}"''; # for users in group "transmission" to have access to torrents - fullSettings = cfg.settings // { umask = 2; }; + fullSettings = { download-dir = downloadDir; incomplete-dir = incompleteDir; } // cfg.settings // { umask = 2; }; in { options = { @@ -35,7 +35,7 @@ in Transmission daemon can be controlled via the RPC interface using transmission-remote or the WebUI (http://localhost:9091/ by default). - Torrents are downloaded to ${homeDir}/Downloads/ by default and are + Torrents are downloaded to ${downloadDir} by default and are accessible to users in the "transmission" group. ''; }; @@ -83,7 +83,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 = '' - ${pkgs.stdenv.shell} -c "chmod 770 ${homeDir} && mkdir -p ${settingsDir} ${downloadDir} ${incompleteDir} && rm -f ${settingsDir}/settings.json && cp -f ${settingsFile} ${settingsDir}/settings.json" + ${pkgs.stdenv.shell} -c "mkdir -p ${homeDir} ${settingsDir} ${fullSettings.download-dir} ${fullSettings.incomplete-dir} && chmod 770 ${homeDir} ${settingsDir} ${fullSettings.download-dir} ${fullSettings.incomplete-dir} && rm -f ${settingsDir}/settings.json && cp -f ${settingsFile} ${settingsDir}/settings.json" ''; serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port}"; serviceConfig.ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; |