depot/third_party/nixpkgs/pkgs/development/tools/fnm/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

44 lines
1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, DiskArbitration
, Foundation
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "fnm";
version = "1.37.1";
src = fetchFromGitHub {
owner = "Schniz";
repo = pname;
rev = "v${version}";
sha256 = "sha256-x6w2g7U/FbJBycMAF4PUyaoIazp/w6imIpy+N7Cf0qk=";
};
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ DiskArbitration Foundation Security ];
cargoHash = "sha256-b15m5DjTDNWJBHOaKSEMwkO/o+0mV+JMBDBurml7xOs=";
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";
mainProgram = "fnm";
homepage = "https://github.com/Schniz/fnm";
license = licenses.gpl3Only;
maintainers = with maintainers; [ kidonng ];
};
}