about summary refs log tree commit diff
path: root/modules/nixos/rtorrent.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/nixos/rtorrent.nix39
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}")

Consider giving Nix/NixOS a try! <3