depot/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

46 lines
1 KiB
Nix

{
lib,
fetchFromGitHub,
gitUpdater,
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=";
};
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
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 ];
};
})