2021-12-05 02:04:28 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, DiskArbitration
|
|
|
|
, Foundation
|
|
|
|
, Security
|
|
|
|
}:
|
2021-08-10 16:31:46 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fnm";
|
2021-12-07 00:06:04 +01:00
|
|
|
version = "1.28.2";
|
2021-08-10 16:31:46 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Schniz";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-07 00:06:04 +01:00
|
|
|
sha256 = "sha256-8/J7LfSk2a0Bq9v6CH63BIyUkT56EY+4UcEUdwkbZ4U=";
|
2021-08-10 16:31:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-12-05 02:04:28 +01:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ DiskArbitration Foundation Security ];
|
2021-08-10 16:31:46 +02:00
|
|
|
|
2021-12-07 00:06:04 +01:00
|
|
|
cargoSha256 = "sha256-k3WZpN6DSbFFKLilFEN2lDMbJH5q1KgfE12OoGv+eGk=";
|
2021-08-10 16:31:46 +02: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 ];
|
|
|
|
};
|
|
|
|
}
|