about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2024-01-24 15:38:00 +0100
committerGitHub <noreply@github.com>2024-01-24 15:38:00 +0100
commit6e808f37166380c22c770671f7f23bc7980a603d (patch)
tree9261c7db1cd4ae397be3e7e386e49768b69a3402 /pkgs/applications/video
parent6fd7935607b68a96949b51ff08f12109e99ffd1f (diff)
parenta8154b773386c87ded47257c6f89116d26cb3202 (diff)
downloadnixlib-6e808f37166380c22c770671f7f23bc7980a603d.tar
nixlib-6e808f37166380c22c770671f7f23bc7980a603d.tar.gz
nixlib-6e808f37166380c22c770671f7f23bc7980a603d.tar.bz2
nixlib-6e808f37166380c22c770671f7f23bc7980a603d.tar.lz
nixlib-6e808f37166380c22c770671f7f23bc7980a603d.tar.xz
nixlib-6e808f37166380c22c770671f7f23bc7980a603d.tar.zst
nixlib-6e808f37166380c22c770671f7f23bc7980a603d.zip
Merge pull request #274831 from ambroisie/add-mpv-cheatsheet
mpvScripts.mpv-cheatsheet: init at 0.30.0.2
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix1
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix42
2 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index 3451b6e3dc47..68ccc3b139d1 100644
--- a/pkgs/applications/video/mpv/scripts/default.nix
+++ b/pkgs/applications/video/mpv/scripts/default.nix
@@ -69,6 +69,7 @@ let
     cutter = callPackage ./cutter.nix { };
     inhibit-gnome = callPackage ./inhibit-gnome.nix { };
     mpris = callPackage ./mpris.nix { };
+    mpv-cheatsheet = callPackage ./mpv-cheatsheet.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-cheatsheet.nix b/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
new file mode 100644
index 000000000000..56013b1fceeb
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
@@ -0,0 +1,42 @@
+{ lib, fetchFromGitHub, nodePackages, stdenvNoCC }:
+stdenvNoCC.mkDerivation (finalAttrs: {
+  pname = "mpv-cheatsheet";
+  version = "0.30.0.2";
+
+  src = fetchFromGitHub {
+    owner = "ento";
+    repo = "mpv-cheatsheet";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-MWK0CYto3zgn3fivmL43tvgZn6XrjPxKLp0lgTFdplM=";
+  };
+
+  nativeBuildInputs = [
+    nodePackages.browserify
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    make dist/${finalAttrs.passthru.scriptName}
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D dist/${finalAttrs.passthru.scriptName} $out/share/mpv/scripts/${finalAttrs.passthru.scriptName}
+
+    runHook postInstall
+  '';
+
+
+  passthru.scriptName = "cheatsheet.js";
+
+  meta = with lib; {
+    description = "mpv script for looking up keyboard shortcuts";
+    homepage = "https://github.com/ento/mpv-cheatsheet";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ambroisie ];
+  };
+})