nixpkgs/pkgs/development/tools/fnm/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

45 lines
1.0 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, installShellFiles
, DiskArbitration
, Foundation
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "fnm";
version = "1.35.1";
src = fetchFromGitHub {
owner = "Schniz";
repo = pname;
rev = "v${version}";
sha256 = "sha256-qRnxXh3m/peMNAR/EV+lkwDI+Z6komF8GGFyF5UDOFg=";
};
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ DiskArbitration Foundation Security ];
cargoHash = "sha256-//DCxAC8Jf7g8SkG4NfwkM0NyWUdASuw1g4COFIY0mU=";
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 ];
};
}