summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
blob: b7e95324f58eaf37265be2a0e4b5aa914e0fc068 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ lib, stdenvNoCC, fetchFromGitHub, youtube-dl }:

stdenvNoCC.mkDerivation rec {
  pname = "mpv-playlistmanager";
  version = "unstable-2021-03-09";

  src = fetchFromGitHub {
    owner = "jonniek";
    repo = "mpv-playlistmanager";
    rev = "c15a0334cf6d4581882fa31ddb1e6e7f2d937a3e";
    sha256 = "uxcvgcSGS61UU8MmuD6qMRqpIa53iasH/vkg1xY7MVc=";
  };

  postPatch = ''
    substituteInPlace playlistmanager.lua \
    --replace "'youtube-dl'" "'${youtube-dl}/bin/youtube-dl'" \
  '';

  dontBuild = true;

  installPhase = ''
    runHook preInstall
    mkdir -p $out/share/mpv/scripts
    cp playlistmanager.lua $out/share/mpv/scripts
    runHook postInstall
  '';

  passthru.scriptName = "playlistmanager.lua";

  meta = with lib; {
    description = "Mpv lua script to create and manage playlists";
    homepage = "https://github.com/jonniek/mpv-playlistmanager";
    license = licenses.unlicense;
    platforms = platforms.all;
    maintainers = with maintainers; [ lunik1 ];
  };
}