depot/third_party/nixpkgs/pkgs/development/tools/fnm/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

43 lines
1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, DiskArbitration
, Foundation
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "fnm";
version = "1.31.1";
src = fetchFromGitHub {
owner = "Schniz";
repo = pname;
rev = "v${version}";
sha256 = "sha256-5DonN9tzap3mMu6/WS5evXtOjpRg4g80evCaSOsTgQA=";
};
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ DiskArbitration Foundation Security ];
cargoSha256 = "sha256-E4Zbk3+fbjZMXRxBcTn9S8XMSts+5m78UIP33oZOsXQ=";
doCheck = false;
postInstall = ''
installShellCompletion --cmd fnm \
--bash <($out/bin/fnm completions --shell bash) \
--fish <($out/bin/fnm completions --shell fish) \
--zsh <($out/bin/fnm completions --shell zsh)
'';
meta = with lib; {
description = "Fast and simple Node.js version manager";
homepage = "https://github.com/Schniz/fnm";
license = licenses.gpl3Only;
maintainers = with maintainers; [ kidonng ];
};
}