Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 46 lines 1.0 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 gitUpdater, 5 nodePackages, 6 stdenvNoCC, 7}: 8stdenvNoCC.mkDerivation (finalAttrs: { 9 pname = "mpv-cheatsheet"; 10 version = "0.30.0.2"; 11 12 src = fetchFromGitHub { 13 owner = "ento"; 14 repo = "mpv-cheatsheet"; 15 rev = "v${finalAttrs.version}"; 16 hash = "sha256-MWK0CYto3zgn3fivmL43tvgZn6XrjPxKLp0lgTFdplM="; 17 }; 18 passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 19 20 nativeBuildInputs = [ nodePackages.browserify ]; 21 22 buildPhase = '' 23 runHook preBuild 24 25 make dist/${finalAttrs.passthru.scriptName} 26 27 runHook postBuild 28 ''; 29 30 installPhase = '' 31 runHook preInstall 32 33 install -D dist/${finalAttrs.passthru.scriptName} $out/share/mpv/scripts/${finalAttrs.passthru.scriptName} 34 35 runHook postInstall 36 ''; 37 38 passthru.scriptName = "cheatsheet.js"; 39 40 meta = with lib; { 41 description = "mpv script for looking up keyboard shortcuts"; 42 homepage = "https://github.com/ento/mpv-cheatsheet"; 43 license = licenses.mit; 44 maintainers = with maintainers; [ ambroisie ]; 45 }; 46})