diff --git a/pkgs/applications/video/mpv/scripts/sponsorblock.nix b/pkgs/applications/video/mpv/scripts/sponsorblock.nix index 35f5fcb549f1..077b8f0590b2 100644 --- a/pkgs/applications/video/mpv/scripts/sponsorblock.nix +++ b/pkgs/applications/video/mpv/scripts/sponsorblock.nix @@ -1,7 +1,7 @@ -{ lib, stdenvNoCC, fetchFromGitHub, fetchpatch, python3, nix-update-script }: +{ lib, buildLua, fetchFromGitHub, fetchpatch, python3, nix-update-script }: # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.sponsorblock ]; }` -stdenvNoCC.mkDerivation { +buildLua { pname = "mpv_sponsorblock"; version = "unstable-2023-01-30"; @@ -12,8 +12,6 @@ stdenvNoCC.mkDerivation { sha256 = "sha256-iUXaTWWFEdxhxClu2NYbQcThlvYty3A2dEYGooeAVAQ="; }; - dontBuild = true; - patches = [ # Use XDG_DATA_HOME and XDG_CACHE_HOME if defined for UID and DB # Necessary to avoid sponsorblock to write in the nix store at runtime. @@ -34,23 +32,16 @@ stdenvNoCC.mkDerivation { --replace 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\"" ''; - installPhase = '' - mkdir -p $out/share/mpv/scripts - cp -r sponsorblock.lua sponsorblock_shared $out/share/mpv/scripts/ - ''; + postInstall = "cp -a sponsorblock_shared $out/share/mpv/scripts/"; - passthru = { - scriptName = "sponsorblock.lua"; - updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; + passthru.updateScript = nix-update-script { + extraArgs = [ "--version=branch" ]; }; meta = with lib; { description = "Script for mpv to skip sponsored segments of YouTube videos"; homepage = "https://github.com/po5/mpv_sponsorblock"; license = licenses.gpl3; - platforms = platforms.all; maintainers = with maintainers; [ pacien ]; }; }