2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, buildLua
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-11-16 04:20:00 +00:00
|
|
|
camelToKebab = let
|
|
|
|
inherit (lib.strings) match stringAsChars toLower;
|
|
|
|
isUpper = match "[A-Z]";
|
|
|
|
in stringAsChars (c: if isUpper c != null then "-${toLower c}" else c);
|
|
|
|
|
|
|
|
mkScript = name: args:
|
|
|
|
buildLua (lib.attrsets.recursiveUpdate rec {
|
|
|
|
pname = camelToKebab name;
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "occivink";
|
|
|
|
repo = "mpv-scripts";
|
|
|
|
rev = "af360f332897dda907644480f785336bc93facf1";
|
|
|
|
hash = "sha256-KdCrUkJpbxxqmyUHksVVc8KdMn8ivJeUA2eerFZfEE8=";
|
|
|
|
};
|
|
|
|
version = "unstable-2022-10-02";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
scriptPath = "scripts/${pname}.lua";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/occivink/mpv-scripts";
|
|
|
|
license = licenses.unlicense;
|
|
|
|
maintainers = with maintainers; [ nicoo ];
|
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
} args);
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
in
|
2023-11-16 04:20:00 +00:00
|
|
|
lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
|
2023-11-16 04:20:00 +00:00
|
|
|
seekTo = {
|
2023-07-15 17:15:38 +00:00
|
|
|
meta.description = "Mpv script for seeking to a specific position";
|
|
|
|
outputHash = "sha256-3RlbtUivmeoR9TZ6rABiZSd5jd2lFv/8p/4irHMLshs=";
|
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
blacklistExtensions = {
|
2023-07-15 17:15:38 +00:00
|
|
|
meta.description = "Automatically remove playlist entries based on their extension.";
|
|
|
|
outputHash = "sha256-qw9lz8ofmvvh23F9aWLxiU4YofY+YflRETu+nxMhvVE=";
|
|
|
|
};
|
|
|
|
}
|