Merge #359866 (mpvScripts: Use lib.packagesFromDirectoryRecursive
)
This commit is contained in:
commit
95428bab8c
@ -282,7 +282,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
;
|
||||
|
||||
wrapper = callPackage ./wrapper.nix { };
|
||||
scripts = callPackage ./scripts { };
|
||||
scripts = callPackage ./scripts.nix { };
|
||||
|
||||
tests = {
|
||||
inherit (nixosTests) mpv;
|
||||
|
@ -82,69 +82,31 @@ let
|
||||
|
||||
scope =
|
||||
self:
|
||||
let
|
||||
inherit (self) callPackage;
|
||||
in
|
||||
lib.mapAttrsRecursiveCond (x: x.recurseForDerivations or false) addTests (
|
||||
lib.recurseIntoAttrs {
|
||||
inherit (callPackage ./mpv.nix { })
|
||||
acompressor
|
||||
autocrop
|
||||
autodeint
|
||||
autoload
|
||||
;
|
||||
inherit (callPackage ./occivink.nix { })
|
||||
blacklistExtensions
|
||||
crop
|
||||
encode
|
||||
seekTo
|
||||
;
|
||||
|
||||
buildLua = callPackage ./buildLua.nix { };
|
||||
autosub = callPackage ./autosub.nix { };
|
||||
autosubsync-mpv = callPackage ./autosubsync-mpv.nix { };
|
||||
chapterskip = callPackage ./chapterskip.nix { };
|
||||
convert = callPackage ./convert.nix { };
|
||||
cutter = callPackage ./cutter.nix { };
|
||||
dynamic-crop = callPackage ./dynamic-crop.nix { };
|
||||
evafast = callPackage ./evafast.nix { };
|
||||
inhibit-gnome = callPackage ./inhibit-gnome.nix { };
|
||||
memo = callPackage ./memo.nix { };
|
||||
manga-reader = callPackage ./manga-reader.nix { };
|
||||
modernx = callPackage ./modernx.nix { };
|
||||
modernx-zydezu = callPackage ./modernx-zydezu.nix { };
|
||||
mpris = callPackage ./mpris.nix { };
|
||||
mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
|
||||
mpv-discord = callPackage ./mpv-discord.nix { };
|
||||
mpv-notify-send = callPackage ./mpv-notify-send.nix { };
|
||||
mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
|
||||
mpv-osc-tethys = callPackage ./mpv-osc-tethys.nix { };
|
||||
mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
|
||||
mpv-slicing = callPackage ./mpv-slicing.nix { };
|
||||
mpv-subtitle-lines = callPackage ./mpv-subtitle-lines.nix { };
|
||||
mpv-webm = callPackage ./mpv-webm.nix { };
|
||||
mpvacious = callPackage ./mpvacious.nix { };
|
||||
quack = callPackage ./quack.nix { };
|
||||
quality-menu = callPackage ./quality-menu.nix { };
|
||||
reload = callPackage ./reload.nix { };
|
||||
simple-mpv-webui = callPackage ./simple-mpv-webui.nix { };
|
||||
smart-copy-paste-2 = callPackage ./smart-copy-paste-2.nix { };
|
||||
smartskip = callPackage ./smartskip.nix { };
|
||||
sponsorblock = callPackage ./sponsorblock.nix { };
|
||||
sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { };
|
||||
thumbfast = callPackage ./thumbfast.nix { };
|
||||
thumbnail = callPackage ./thumbnail.nix { };
|
||||
uosc = callPackage ./uosc.nix { };
|
||||
videoclip = callPackage ./videoclip.nix { };
|
||||
visualizer = callPackage ./visualizer.nix { };
|
||||
vr-reversal = callPackage ./vr-reversal.nix { };
|
||||
webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
|
||||
youtube-chat = callPackage ./youtube-chat.nix { };
|
||||
youtube-upnext = callPackage ./youtube-upnext.nix { };
|
||||
with lib;
|
||||
pipe
|
||||
{
|
||||
inherit (self) callPackage;
|
||||
directory = ./scripts;
|
||||
}
|
||||
);
|
||||
[
|
||||
packagesFromDirectoryRecursive
|
||||
recurseIntoAttrs
|
||||
(mapAttrsRecursiveCond (x: x.recurseForDerivations or false) addTests)
|
||||
];
|
||||
|
||||
aliases = {
|
||||
mkAliases = self: {
|
||||
inherit (self.builtins)
|
||||
acompressor
|
||||
autocrop
|
||||
autodeint
|
||||
autoload
|
||||
; # added 2024-11-28
|
||||
inherit (self.occivink)
|
||||
blacklistExtensions
|
||||
crop
|
||||
encode
|
||||
seekTo
|
||||
; # added 2024-11-28
|
||||
youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
|
||||
};
|
||||
in
|
||||
@ -153,6 +115,9 @@ lib.pipe scope [
|
||||
(lib.makeScope newScope)
|
||||
(
|
||||
self:
|
||||
let
|
||||
aliases = mkAliases self;
|
||||
in
|
||||
assert builtins.intersectAttrs self aliases == { };
|
||||
self // lib.optionalAttrs config.allowAliases aliases
|
||||
)
|
44
pkgs/applications/video/mpv/scripts/builtins.nix
Normal file
44
pkgs/applications/video/mpv/scripts/builtins.nix
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
lib,
|
||||
buildLua,
|
||||
mpv-unwrapped,
|
||||
}:
|
||||
|
||||
let
|
||||
mkBuiltin =
|
||||
name: args:
|
||||
let
|
||||
srcPath = "TOOLS/lua/${name}.lua";
|
||||
in
|
||||
buildLua (
|
||||
lib.attrsets.recursiveUpdate rec {
|
||||
inherit (mpv-unwrapped) src version;
|
||||
pname = "mpv-${name}";
|
||||
|
||||
dontUnpack = true;
|
||||
scriptPath = "${src}/${srcPath}";
|
||||
|
||||
meta = with lib; {
|
||||
inherit (mpv-unwrapped.meta) license;
|
||||
homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}";
|
||||
};
|
||||
} args
|
||||
);
|
||||
in
|
||||
lib.recurseIntoAttrs (
|
||||
lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) {
|
||||
acompressor.meta = {
|
||||
description = "Script to toggle and control ffmpeg's dynamic range compression filter";
|
||||
maintainers = with lib.maintainers; [ nicoo ];
|
||||
};
|
||||
|
||||
autocrop.meta.description = "This script uses the lavfi cropdetect filter to automatically insert a crop filter with appropriate parameters for the currently playing video";
|
||||
|
||||
autodeint.meta.description = "This script uses the lavfi idet filter to automatically insert the appropriate deinterlacing filter based on a short section of the currently playing video";
|
||||
|
||||
autoload.meta = {
|
||||
description = "This script automatically loads playlist entries before and after the currently played file";
|
||||
maintainers = [ lib.maintainers.dawidsowa ];
|
||||
};
|
||||
}
|
||||
)
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildLua,
|
||||
mpv-unwrapped,
|
||||
}:
|
||||
|
||||
let
|
||||
mkBuiltin =
|
||||
name: args:
|
||||
let
|
||||
srcPath = "TOOLS/lua/${name}.lua";
|
||||
in
|
||||
buildLua (
|
||||
lib.attrsets.recursiveUpdate rec {
|
||||
inherit (mpv-unwrapped) src version;
|
||||
pname = "mpv-${name}";
|
||||
|
||||
dontUnpack = true;
|
||||
scriptPath = "${src}/${srcPath}";
|
||||
|
||||
meta = with lib; {
|
||||
inherit (mpv-unwrapped.meta) license;
|
||||
homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}";
|
||||
};
|
||||
} args
|
||||
);
|
||||
in
|
||||
lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) {
|
||||
acompressor.meta = {
|
||||
description = "Script to toggle and control ffmpeg's dynamic range compression filter";
|
||||
maintainers = with lib.maintainers; [ nicoo ];
|
||||
};
|
||||
|
||||
autocrop.meta.description = "This script uses the lavfi cropdetect filter to automatically insert a crop filter with appropriate parameters for the currently playing video";
|
||||
|
||||
autodeint.meta.description = "This script uses the lavfi idet filter to automatically insert the appropriate deinterlacing filter based on a short section of the currently playing video";
|
||||
|
||||
autoload.meta = {
|
||||
description = "This script automatically loads playlist entries before and after the currently played file";
|
||||
maintainers = [ lib.maintainers.dawidsowa ];
|
||||
};
|
||||
}
|
@ -42,19 +42,21 @@ let
|
||||
in
|
||||
buildLua (lib.attrsets.recursiveUpdate self args);
|
||||
in
|
||||
lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
|
||||
lib.recurseIntoAttrs (
|
||||
lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
|
||||
|
||||
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
|
||||
crop.meta.description = "Crop the current video in a visual manner";
|
||||
seekTo.meta.description = "Mpv script for seeking to a specific position";
|
||||
blacklistExtensions.meta.description = "Automatically remove playlist entries based on their extension";
|
||||
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
|
||||
crop.meta.description = "Crop the current video in a visual manner";
|
||||
seekTo.meta.description = "Mpv script for seeking to a specific position";
|
||||
blacklistExtensions.meta.description = "Automatically remove playlist entries based on their extension";
|
||||
|
||||
encode = {
|
||||
meta.description = "Make an extract of the video currently playing using ffmpeg";
|
||||
encode = {
|
||||
meta.description = "Make an extract of the video currently playing using ffmpeg";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace scripts/encode.lua \
|
||||
--replace-fail '"ffmpeg"' '"${lib.getExe ffmpeg}"'
|
||||
'';
|
||||
};
|
||||
}
|
||||
postPatch = ''
|
||||
substituteInPlace scripts/encode.lua \
|
||||
--replace-fail '"ffmpeg"' '"${lib.getExe ffmpeg}"'
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user