-
-
Save grahamc/f02121d0d69d8632fc534990d4b67088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
{ url, sha256 }: | |
pkgs.runCommand | |
(pkgs.lib.strings.removeSuffix ".torrent" (builtins.baseNameOf url)) | |
{ | |
buildInputs = [ pkgs.transmission pkgs.procps ]; | |
outputHashMode = "flat"; | |
outputHashAlgo = "sha256"; | |
outputHash = sha256; | |
} | |
'' | |
HOME=$(pwd) | |
echo "#!/bin/sh" > script | |
echo "pkill transmission" >> script | |
chmod +x ./script | |
mkdir ./results | |
transmission-cli \ | |
--no-portmap \ | |
--finish "$(pwd)/script" \ | |
--download-dir ./results \ | |
'${url}' \ | |
|| true | |
mv ./results/* $out | |
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment