From 320550f17a213a44724a7699823bf42729e956ea Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Mon, 18 Mar 2024 14:32:03 +0800 Subject: [PATCH] mpvScripts.mpv-osc-modern: init at 1.1.1 --- .../video/mpv/scripts/default.nix | 1 + .../video/mpv/scripts/mpv-osc-modern.nix | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index 420d0278558d..80f0a17a9cb7 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -72,6 +72,7 @@ let modernx-zydezu = callPackage ./modernx-zydezu.nix { }; mpris = callPackage ./mpris.nix { }; mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { }; + mpv-osc-modern = callPackage ./mpv-osc-modern.nix { }; mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { }; mpv-webm = callPackage ./mpv-webm.nix { }; mpvacious = callPackage ./mpvacious.nix { }; diff --git a/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix b/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix new file mode 100644 index 000000000000..ce32622d64d8 --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix @@ -0,0 +1,39 @@ +{ lib +, buildLua +, fetchFromGitHub +, makeFontsConf +, nix-update-script +}: +buildLua (finalAttrs: { + pname = "mpv-osc-modern"; + version = "1.1.1"; + + scriptPath = "modern.lua"; + src = fetchFromGitHub { + owner = "maoiscat"; + repo = "mpv-osc-modern"; + rev = "v${finalAttrs.version}"; + hash = "sha256-RMUy8UpSRSCEPAbnGLpJ2NjDsDdkjq8cNsdGwsQ5ANU="; + }; + + postInstall = '' + mkdir -p $out/share/fonts + cp -r *.ttf $out/share/fonts + ''; + passthru.extraWrapperArgs = [ + "--set" + "FONTCONFIG_FILE" + (toString (makeFontsConf { + fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ]; + })) + ]; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "Another MPV OSC Script"; + homepage = "https://github.com/maoiscat/mpv-osc-modern"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ Guanran928 ]; + }; +})