diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-11-25 18:09:05 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-11-25 18:09:05 +0300 |
commit | e2cc46b37e33643cf3dd017adb8a009bf143e246 (patch) | |
tree | 86f24ea544e9ed75bf8736c951a09dfdb2219f5d /modules/nixos/rtorrent.nix | |
parent | 2023-11-23 (diff) |
2023-11-25
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/rtorrent.nix | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/modules/nixos/rtorrent.nix b/modules/nixos/rtorrent.nix index 847f12d..c39f306 100644 --- a/modules/nixos/rtorrent.nix +++ b/modules/nixos/rtorrent.nix @@ -44,27 +44,24 @@ in { sessionDir = "${baseDir}/session"; logDir = "${baseDir}/log"; configFile = let - moveCompleted = let - pkg = pkgs.writeShellApplication { - name = "move-completed"; - runtimeInputs = with pkgs; [ - coreutils-full - gnused - findutils - ]; - text = '' - set -x - - leech_path="$1" - seed_path="$2" - # seed_path="$(echo "$2" | sed 's@+@ @g;s@%@\\x@g' | xargs -0 printf '%b')" - - mkdir -pv "$seed_path" - mv -fv "$leech_path" "$seed_path" - ''; - }; - in - getExe pkg; + moveCompleted = getExe (pkgs.writeShellApplication { + name = "move-completed"; + runtimeInputs = with pkgs; [ + coreutils-full + gnused + findutils + ]; + text = '' + set -x + + leech_path="$1" + seed_path="$2" + # seed_path="$(echo "$2" | sed 's@+@ @g;s@%@\\x@g' | xargs -0 printf '%b')" + + mkdir -pv "$seed_path" + mv -fv "$leech_path" "$seed_path" + ''; + }); in pkgs.writeText "rtorrent.rc" '' method.insert = cfg.leech, private|const|string, (cat, "${leechDir}") |