From 16818343f11972ed7f591080992ba146790cc2f1 Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Sun, 5 Mar 2023 01:22:46 +0100 Subject: [PATCH 1/3] maintainers: add apfelkuchen6 --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 94e3737b2459..ba068de02034 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1096,6 +1096,12 @@ githubId = 1078530; name = "Alexandre Peyroux"; }; + apfelkuchen6 = { + email = "apfelkuchen6@hrnz.li"; + github = "apfelkuchen6"; + githubId = 73002165; + name = "apfelkuchen6"; + }; applePrincess = { email = "appleprincess@appleprincess.io"; github = "applePrincess"; From 481f02f7dd1b21ddfc363ec30b99fcfac04deaec Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Tue, 7 Mar 2023 01:53:06 +0100 Subject: [PATCH 2/3] mpv: allow scripts to add wrapper args --- pkgs/applications/video/mpv/wrapper.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/video/mpv/wrapper.nix b/pkgs/applications/video/mpv/wrapper.nix index e9be744ed01c..0dd735071f00 100644 --- a/pkgs/applications/video/mpv/wrapper.nix +++ b/pkgs/applications/video/mpv/wrapper.nix @@ -18,6 +18,7 @@ let # expected to have a `scriptName` passthru attribute that points to the # name of the script that would reside in the script's derivation's # `$out/share/mpv/scripts/`. + # A script can optionally also provide an `extraWrapperArgs` passthru attribute. scripts ? [], extraUmpvWrapperArgs ? [] }: @@ -49,6 +50,8 @@ let # attribute of the script derivation from the `scripts` "--script=${script}/share/mpv/scripts/${script.scriptName}" ] + # scripts can also set the `extraWrapperArgs` passthru + ++ (script.extraWrapperArgs or []) ) scripts )) ++ extraMakeWrapperArgs) ; From 19f0a78c195223e7021ff4d16bad71c6f4cb981d Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Tue, 7 Mar 2023 01:53:20 +0100 Subject: [PATCH 3/3] mpvScripts.uosc: init at 4.6.0 --- pkgs/applications/video/mpv/scripts/uosc.nix | 48 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/applications/video/mpv/scripts/uosc.nix diff --git a/pkgs/applications/video/mpv/scripts/uosc.nix b/pkgs/applications/video/mpv/scripts/uosc.nix new file mode 100644 index 000000000000..1a486dbf556d --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/uosc.nix @@ -0,0 +1,48 @@ +{ stdenvNoCC, lib, fetchFromGitHub, makeFontsConf }: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "uosc"; + version = "4.6.0"; + + src = fetchFromGitHub { + owner = "tomasklaen"; + repo = "uosc"; + rev = finalAttrs.version; + hash = "sha256-AxApKlSaRLPl6VsXsARfaT3kWDK6AB2AAEmIHYiuFaM="; + }; + + postPatch = '' + substituteInPlace scripts/uosc.lua \ + --replace "mp.find_config_file('scripts')" "\"$out/share/mpv/scripts\"" + ''; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/mpv/ + cp -r scripts $out/share/mpv + cp -r fonts $out/share + + runHook postInstall + ''; + + passthru.scriptName = "uosc.lua"; + # the script uses custom "texture" fonts as the background for ui elements. + # In order for mpv to find them, we need to adjust the fontconfig search path. + passthru.extraWrapperArgs = [ + "--set" + "FONTCONFIG_FILE" + (toString (makeFontsConf { + fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ]; + })) + ]; + + meta = with lib; { + description = "Feature-rich minimalist proximity-based UI for MPV player"; + homepage = "https://github.com/tomasklaen/uosc"; + license = licenses.gpl3Only; + maintainers = with lib.maintainers; [ apfelkuchen6 ]; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04074f2a09e7..f6324c453e68 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31765,6 +31765,7 @@ with pkgs; simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix {}; sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix {}; thumbnail = callPackage ../applications/video/mpv/scripts/thumbnail.nix { }; + uosc = callPackage ../applications/video/mpv/scripts/uosc.nix { }; vr-reversal = callPackage ../applications/video/mpv/scripts/vr-reversal.nix {}; webtorrent-mpv-hook = callPackage ../applications/video/mpv/scripts/webtorrent-mpv-hook.nix { }; youtube-quality = callPackage ../applications/video/mpv/scripts/youtube-quality.nix { };