nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 53 lines 1.2 kB view raw
1{ 2 lib, 3 mkYarnPackage, 4 fetchFromGitHub, 5 fetchYarnDeps, 6}: 7 8mkYarnPackage rec { 9 pname = "near-cli"; 10 version = "3.4.2"; 11 12 src = fetchFromGitHub { 13 owner = "near"; 14 repo = "near-cli"; 15 rev = "v${version}"; 16 hash = "sha256-C+viNYk+6BA11cdi5GqARU3QTTONTR2B2VEZf/SeeSQ="; 17 }; 18 19 packageJSON = ./package.json; 20 21 offlineCache = fetchYarnDeps { 22 yarnLock = "${src}/yarn.lock"; 23 hash = "sha256-G/Y8xGGOlXH37Bup7mKhEaNh05GTP5CC9e/Xw4TBNMU="; 24 }; 25 26 doDist = false; 27 28 installPhase = '' 29 runHook preInstall 30 31 mkdir -p "$out/lib/node_modules" 32 mv deps/near-cli "$out/lib/node_modules" 33 rm "$out/lib/node_modules/near-cli/node_modules" 34 mv node_modules "$out/lib/node_modules/near-cli" 35 36 mkdir -p "$out/bin" 37 ln -s "$out/lib/node_modules/near-cli/bin/near" "$out/bin" 38 39 runHook postInstall 40 ''; 41 42 meta = { 43 changelog = "https://github.com/near/near-cli/blob/${src.rev}/CHANGELOG.md"; 44 description = "General purpose command line tools for interacting with NEAR Protocol"; 45 homepage = "https://github.com/near/near-cli"; 46 license = with lib.licenses; [ 47 asl20 48 mit 49 ]; 50 mainProgram = "near"; 51 maintainers = with lib.maintainers; [ ekleog ]; 52 }; 53}