about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
blob: be314ed8ca1688a446c13c3bc0ef210ced49bedd (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,
  buildLua,
  fetchFromGitea,
  unstableGitUpdater,
  curl,
  coreutils,
}:

buildLua {
  pname = "mpv_sponsorblock_minimal";
  version = "0-unstable-2023-08-20";
  scriptPath = "sponsorblock_minimal.lua";

  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "jouni";
    repo = "mpv_sponsorblock_minimal";
    rev = "ca2844b8cf7674bfccd282d389a50427742251d3";
    hash = "sha256-28HWZ6nOhKiE+5Ya1N3Vscd8aeH9OKS0t72e/xPfFQQ=";
  };
  passthru.updateScript = unstableGitUpdater { };

  preInstall = ''
    substituteInPlace sponsorblock_minimal.lua \
      --replace-fail "curl" "${lib.getExe curl}" \
      --replace-fail "sha256sum" "${lib.getExe' coreutils "sha256sum"}"
  '';

  meta = with lib; {
    description = "A minimal script to skip sponsored segments of YouTube videos";
    homepage = "https://codeberg.org/jouni/mpv_sponsorblock_minimal";
    license = licenses.gpl3Only;
    platforms = platforms.all;
    maintainers = with maintainers; [ arthsmn ];
  };
}