diff --git a/configs/workhorse/transmission.nix b/configs/workhorse/transmission.nix index 674d691..e89e251 100644 --- a/configs/workhorse/transmission.nix +++ b/configs/workhorse/transmission.nix @@ -95,6 +95,18 @@ in { # Start torrents as soon as they are added start-added-torrents = true; + script-torrent-done-enabled = true; + script-torrent-done-filename = + (pkgs.writers.writeBash "torrent-finished" '' + JSON_STRING=$( ${pkgs.jq}/bin/jq -n --arg torrent_name "$TR_TORRENT_NAME" \ + '{text: ":tada: \($torrent_name)", channel: "torrent"}' ) + ${pkgs.curl}/bin/curl \ + --include \ + --request POST \ + --data-urlencode \ + "payload=$JSON_STRING" \ + ${lib.fileContents } + ''); }; };