Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at litex 40 lines 1.4 kB view raw
1{ lib, fetchFromGitHub, fetchzip, nodejs, stdenvNoCC, testers }: 2 3let 4 completion = fetchFromGitHub { 5 owner = "dsifford"; 6 repo = "yarn-completion"; 7 rev = "v0.17.0"; 8 hash = "sha256-z7KPXeYPPRuaEPxgY6YqsLt9n8cSsW3n2FhOzVde1HU="; 9 }; 10in 11stdenvNoCC.mkDerivation (finalAttrs: { 12 pname = "yarn"; 13 version = "1.22.19"; 14 15 src = fetchzip { 16 url = "https://github.com/yarnpkg/yarn/releases/download/v${finalAttrs.version}/yarn-v${finalAttrs.version}.tar.gz"; 17 sha256 = "sha256-12wUuWH+kkqxAgVYkyhIYVtexjv8DFP9kLpFLWg+h0o="; 18 }; 19 20 buildInputs = [ nodejs ]; 21 22 installPhase = '' 23 mkdir -p $out/{bin,libexec/yarn/,share/bash-completion/completions/} 24 cp -R . $out/libexec/yarn 25 ln -s $out/libexec/yarn/bin/yarn.js $out/bin/yarn 26 ln -s $out/libexec/yarn/bin/yarn.js $out/bin/yarnpkg 27 ln -s ${completion}/yarn-completion.bash $out/share/bash-completion/completions/yarn.bash 28 ''; 29 30 passthru.tests = testers.testVersion { package = finalAttrs.finalPackage; }; 31 32 meta = with lib; { 33 description = "Fast, reliable, and secure dependency management for javascript"; 34 homepage = "https://classic.yarnpkg.com/"; 35 changelog = "https://github.com/yarnpkg/yarn/blob/v${finalAttrs.version}/CHANGELOG.md"; 36 license = licenses.bsd2; 37 maintainers = with maintainers; [ offline screendriver marsam ]; 38 platforms = nodejs.meta.platforms; 39 }; 40})