···243244***
245```
246-## `fetchFromBittorrent` {#fetchfrombittorrent}
247248-`fetchFromBittorrent` expects two arguments. `url` which can either be a Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file. It can also take a `config` argument which will craft a `settings.json` configuration file and give it to `transmission`, the underlying program that is performing the fetch. The available config options for `transmission` can be found [here](https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options)
249250```
251-{ fetchFromBittorrent }:
252253-fetchFromBittorrent {
254 config = { peer-limit-global = 100; };
255 url = "magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c";
256 sha256 = "";
257}
258```
259260-### Parameters {#fetchfrombittorrent-parameters}
261262- `url`: Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file.
263
···243244***
245```
246+## `fetchtorrent` {#fetchtorrent}
247248+`fetchtorrent` expects two arguments. `url` which can either be a Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file. It can also take a `config` argument which will craft a `settings.json` configuration file and give it to `transmission`, the underlying program that is performing the fetch. The available config options for `transmission` can be found [here](https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options)
249250```
251+{ fetchtorrent }:
252253+fetchtorrent {
254 config = { peer-limit-global = 100; };
255 url = "magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c";
256 sha256 = "";
257}
258```
259260+### Parameters {#fetchtorrent-parameters}
261262- `url`: Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file.
263
···30 jsonConfig = (formats.json {}).generate "jsonConfig" config;
31in
32runCommand name {
33- nativeBuildInputs = [ cacert ] ++ (if (backend == "transmission" ) then [ transmission_noSystemd ] else if (backend == "rqbit") then [ rqbit ] else throw "rqbit or transmission are the only available backends for fetchbittorrent");
34 outputHashAlgo = if hash != "" then null else "sha256";
35 outputHash = hash;
36 outputHashMode = if recursiveHash then "recursive" else "flat";
3738 # url will be written to the derivation, meaning it can be parsed and utilized
39- # by external tools, such as tools that may want to seed fetchBittorrent calls
40 # in nixpkgs
41 inherit url;
42}
···30 jsonConfig = (formats.json {}).generate "jsonConfig" config;
31in
32runCommand name {
33+ nativeBuildInputs = [ cacert ] ++ (if (backend == "transmission" ) then [ transmission_noSystemd ] else if (backend == "rqbit") then [ rqbit ] else throw "rqbit or transmission are the only available backends for fetchtorrent");
34 outputHashAlgo = if hash != "" then null else "sha256";
35 outputHash = hash;
36 outputHashMode = if recursiveHash then "recursive" else "flat";
3738 # url will be written to the derivation, meaning it can be parsed and utilized
39+ # by external tools, such as tools that may want to seed fetchtorrent calls
40 # in nixpkgs
41 inherit url;
42}