2021-08-10 15:31:46 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, installShellFiles, Security }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fnm";
|
2021-09-17 06:17:31 +01:00
|
|
|
version = "1.27.0";
|
2021-08-10 15:31:46 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Schniz";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-09-17 06:17:31 +01:00
|
|
|
sha256 = "sha256-4qnisgWhdAWZda8iy9nkph7//bVKJuUeEDS1GaAx+FQ=";
|
2021-08-10 15:31:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
2021-09-17 06:17:31 +01:00
|
|
|
cargoSha256 = "sha256-f3wzuXH2ByXHHOq3zLaMtYm2HJ4BzmZe2e6DQ3V7qVo=";
|
2021-08-10 15:31:46 +01:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|