diff options
author | jeschli <jeschli@gmail.com> | 2018-08-21 19:52:30 +0200 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2018-08-21 19:52:30 +0200 |
commit | 8cfc4f5eda10b1025a4ad3b9725deb9ad7a32338 (patch) | |
tree | 4a9626e685bc076461f5e63c55e29e3689d2eedd /makefu/2configs/torrent.nix | |
parent | f2dadea808323f69531c51b12ed5cb872ac933a0 (diff) | |
parent | 89951ebd816248bc4e62b2dad78b5db906c3cefe (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'makefu/2configs/torrent.nix')
-rw-r--r-- | makefu/2configs/torrent.nix | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/makefu/2configs/torrent.nix b/makefu/2configs/torrent.nix index a076479c2..3df0ddbfe 100644 --- a/makefu/2configs/torrent.nix +++ b/makefu/2configs/torrent.nix @@ -8,13 +8,13 @@ let peer-port = 51412; web-port = 8112; daemon-port = 58846; - torrent-dir = config.makefu.dl-dir; + base-dir = config.makefu.dl-dir; in { users.users = { download = { name = "download"; - home = torrent-dir; + home = base-dir; uid = mkDefault (genid "download"); createHome = true; useDefaultShell = true; @@ -25,10 +25,12 @@ in { # todo: race condition, do this after download user has been created system.activationScripts."download-dir-chmod" = '' - for i in finished watch torrents; do - mkdir -p "${torrent-dir}/$i" - chown download:download "${torrent-dir}/$i" - chmod 770 "${torrent-dir}/$i" + for i in finished watch; do + if test ! -d $i;then + mkdir -p "${base-dir}/$i" + chown rtorrent:download "${base-dir}/$i" + chmod 775 "${base-dir}/$i" + fi done ''; @@ -42,6 +44,7 @@ in { "nginx" ]; }; + rtorrent.members = [ "download" ]; }; krebs.rtorrent = { @@ -54,7 +57,8 @@ in { rutorrent.enable = true; enableXMLRPC = true; listenPort = peer-port; - workDir = torrent-dir; + downloadDir = base-dir + "/finished"; + watchDir = base-dir + "/watch"; # dump old torrents into watch folder to have them re-added }; |