11 pname = "webtorrent-mpv-hook";
14 src = fetchFromGitHub {
18 hash = "sha256-/dMtXcIyfAs++Zgz2CxRW0tkzn5QjS+WVGChlCyrU0U=";
20 passthru.updateScript = gitUpdater { rev-prefix = "v"; };
23 substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${lib.getExe nodejs}'"
24 # This executable is just for telling non-Nix users how to install
25 substituteInPlace package.json --replace-fail '"bin": "build/bin.mjs",' ""
29 npmDepsHash = "sha256-EqHPBoYyBuW9elxQH/XVTZoPkKHC6+7aksYo60t7WA4=";
30 makeCacheWritable = true;
33 python3 # Fixes node-gyp on aarch64-linux
37 mkdir -p $out/share/mpv/scripts/
38 ln -s $out/lib/node_modules/webtorrent-mpv-hook/build/webtorrent.js $out/share/mpv/scripts/
40 passthru.scriptName = "webtorrent.js";
43 description = "Adds a hook that allows mpv to stream torrents";
44 homepage = "https://github.com/mrxdst/webtorrent-mpv-hook";
45 maintainers = [ lib.maintainers.chuangzhu ];
46 license = lib.licenses.isc;