2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, DiskArbitration
|
|
|
|
, Foundation
|
|
|
|
, Security
|
|
|
|
}:
|
2021-08-10 14:31:46 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fnm";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.37.0";
|
2021-08-10 14:31:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Schniz";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
sha256 = "sha256-ruEv46jzO79l2Nvs3UjWHal2lBmhjdIKC99va/2cGio=";
|
2021-08-10 14:31:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ DiskArbitration Foundation Security ];
|
2021-08-10 14:31:46 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoHash = "sha256-ez6rzmVa/eRcd4bdCM4JEaNILpavub34kaonX4BRjW8=";
|
2021-08-10 14:31:46 +00: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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "fnm";
|
2021-08-10 14:31:46 +00:00
|
|
|
homepage = "https://github.com/Schniz/fnm";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ kidonng ];
|
|
|
|
};
|
|
|
|
}
|