about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix')
-rw-r--r--nixpkgs/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix b/nixpkgs/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
new file mode 100644
index 000000000000..56013b1fceeb
--- /dev/null
+++ b/nixpkgs/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 ];
+  };
+})