~andir/nixpkgs-dev

mpvScripts.webtorrent-hook: init at unstable-2020-04-18 v3 PROPOSED

yoctocell: 1
 mpvScripts.webtorrent-hook: init at unstable-2020-04-18

 2 files changed, 37 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~andir/nixpkgs-dev/patches/16170/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH v3] mpvScripts.webtorrent-hook: init at unstable-2020-04-18 Export this patch

---
Patch webtorrent-hook.lua to look in the nix store.

 .../video/mpv/scripts/webtorrent-hook.nix     | 36 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 pkgs/applications/video/mpv/scripts/webtorrent-hook.nix

diff --git a/pkgs/applications/video/mpv/scripts/webtorrent-hook.nix b/pkgs/applications/video/mpv/scripts/webtorrent-hook.nix
new file mode 100644
index 00000000000..501ef208402
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/webtorrent-hook.nix
@@ -0,0 +1,36 @@
{ stdenv, fetchFromGitHub, nodePackages }:

stdenv.mkDerivation rec {
  name = "webtorrent-hook";
  version = "unstable-2020-04-18";

  src = fetchFromGitHub {
    owner = "noctuid";
    repo = "mpv-webtorrent-hook";
    rev = "755c6348e10279cb6049264c319e86afc1f830f3";
    sha256 = "2igEC1Z2yAObx9boJexFF+b25V2tylyVyNfF7xLd3YI=";
  };

  dontBuild = true;

  buildInputs = [ nodePackages.webtorrent-cli ];

  patchPhase = ''
    sed -i 's,"webtorrent ","${nodePackages.webtorrent-cli}/bin/webtorrent ",' webtorrent-hook.lua 
  '';

  installPhase = ''
    mkdir -p $out/share/mpv/scripts
    cp webtorrent-hook.lua $out/share/mpv/scripts/
  '';

  passthru.scriptName = "webtorrent-hook.lua";

  meta = with stdenv.lib; {
    description = "Stream torrents in mpv using webtorrent-cli";
    homepage = "https://github.com/noctuid/mpv-webtorrent-hook";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ yoctocell ];
  };
}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4cdf4ec1650..94b3772d154 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -22898,6 +22898,7 @@ in
    mpris = callPackage ../applications/video/mpv/scripts/mpris.nix {};
    simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix {};
    sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix {};
    webtorrent-hook = callPackage ../applications/video/mpv/scripts/webtorrent-hook.nix {};
  };

  mrpeach = callPackage ../applications/audio/pd-plugins/mrpeach { };
-- 
2.29.2