about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorGuanran Wang <guanran928@outlook.com>2024-03-18 14:30:18 +0800
committerGuanran Wang <guanran928@outlook.com>2024-03-22 13:03:20 +0800
commit8871be39b15763ded437771e21ca936d85f1ad0e (patch)
tree50f27f89fd2af751ebb9abc6cf81f0df10d2bf0f /pkgs/applications/video
parent72e1c81dfa6769d67c6a9b5b5ab30919db386b28 (diff)
mpvScripts.modernx: init at 0.6.0
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix1
-rw-r--r--pkgs/applications/video/mpv/scripts/modernx.nix39
2 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index 68ccc3b139d15..6d36e0241d919 100644
--- a/pkgs/applications/video/mpv/scripts/default.nix
+++ b/pkgs/applications/video/mpv/scripts/default.nix
@@ -68,6 +68,7 @@ let
     convert = callPackage ./convert.nix { };
     cutter = callPackage ./cutter.nix { };
     inhibit-gnome = callPackage ./inhibit-gnome.nix { };
+    modernx = callPackage ./modernx.nix { };
     mpris = callPackage ./mpris.nix { };
     mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
     mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
diff --git a/pkgs/applications/video/mpv/scripts/modernx.nix b/pkgs/applications/video/mpv/scripts/modernx.nix
new file mode 100644
index 0000000000000..e6e9ec6110c4f
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/modernx.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildLua
+, fetchFromGitHub
+, makeFontsConf
+, nix-update-script
+}:
+buildLua (finalAttrs: {
+  pname = "modernx";
+  version = "0.6.0";
+
+  scriptPath = "modernx.lua";
+  src = fetchFromGitHub {
+    owner = "cyl0";
+    repo = "ModernX";
+    rev = finalAttrs.version;
+    hash = "sha256-Gpofl529VbmdN7eOThDAsNfNXNkUDDF82Rd+csXGOQg=";
+  };
+
+  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 = "A modern OSC UI replacement for MPV that retains the functionality of the default OSC";
+    homepage = "https://github.com/cyl0/ModernX";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ Guanran928 ];
+  };
+})