Skip to content

Instantly share code, notes, and snippets.

@framp
Created June 8, 2022 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save framp/29e883d2385ab5365f7df93587faf8f1 to your computer and use it in GitHub Desktop.
Save framp/29e883d2385ab5365f7df93587faf8f1 to your computer and use it in GitHub Desktop.
use with (pkgs.callPackage ./custom/volta.nix { }); credits https://github.com/NixOS/nixpkgs/pull/130552
{ lib, fetchFromGitHub, rustPlatform, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "volta";
version = "1.0.8";
src = fetchFromGitHub {
owner = "volta-cli";
repo = pname;
rev = "v${version}";
sha256 = "sha256-qffsfGw40z7K3kWNV4F2qigX0/48+LhwvTZPzt3DpLk=";
};
nativeBuildInputs = [ installShellFiles ];
cargoSha256 = "sha256-1w9ktPc/GvfU+tlC0oJ5HhxkeVICYBAKwpTVeUxYcS0=";
postInstall = ''
installShellCompletion --cmd volta \
--bash <($out/bin/volta completions bash) \
--fish <($out/bin/volta completions fish) \
--zsh <($out/bin/volta completions zsh)
'';
meta = with lib; {
description = "JavaScript toolchain manager for reproducible environments";
homepage = "https://volta.sh/";
license = lib.licenses.bsd2;
maintainers = with maintainers; [ kidonng ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment