Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 rustPlatform, 4 libiconv, 5 stdenv, 6 installShellFiles, 7 darwin, 8 fetchFromGitHub, 9}: 10rustPlatform.buildRustPackage rec { 11 pname = "volta"; 12 version = "1.1.1"; 13 14 src = fetchFromGitHub { 15 owner = "volta-cli"; 16 repo = "volta"; 17 rev = "v${version}"; 18 hash = "sha256-+j3WRpunV+3YfZnyuKA/CsiKr+gOaP2NbmnyoGMN+Mg="; 19 }; 20 21 cargoLock = { 22 lockFile = ./Cargo.lock; 23 outputHashes = { 24 "detect-indent-0.1.0" = "sha256-qtPkPaBiyuT8GhpEFdU7IkAgKnCbTES0FB2CvNKWqic="; 25 "semver-0.9.0" = "sha256-nw1somkZe9Qi36vjfWlTcDqHAIbaJj72KBTfmucVxXs="; 26 "semver-parser-0.10.0" = "sha256-iTGnKSddsriF6JS6lvJNjp9aDzGtfjrHEiCijeie3uE="; 27 }; 28 }; 29 30 buildInputs = [ installShellFiles ] 31 ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security libiconv ]; 32 33 HOME = "$TMPDIR"; 34 35 postInstall = '' 36 installShellCompletion --cmd volta \ 37 --bash <($out/bin/volta completions bash) \ 38 --fish <($out/bin/volta completions fish) \ 39 --zsh <($out/bin/volta completions zsh) 40 ''; 41 meta = with lib; { 42 description = "Hassle-Free JavaScript Tool Manager"; 43 longDescription = '' 44 With Volta, you can select a Node engine once and then stop worrying 45 about it. You can switch between projects and stop having to manually 46 switch between Nodes. You can install npm package binaries in your 47 toolchain without having to periodically reinstall them or figure out why 48 theyve stopped working. 49 50 Note: Volta cannot be used on NixOS out of the box because it downloads 51 Node binaries that assume shared libraries are in FHS standard locations. 52 ''; 53 homepage = "https://volta.sh/"; 54 changelog = "https://github.com/volta-cli/volta/blob/main/RELEASES.md"; 55 license = with licenses; [ bsd2 ]; 56 maintainers = with maintainers; [ fbrs ]; 57 }; 58}