diff --git a/pkgs/development/tools/nodenv/default.nix b/pkgs/development/tools/nodenv/default.nix new file mode 100644 index 000000000000..d1e38d7bda74 --- /dev/null +++ b/pkgs/development/tools/nodenv/default.nix @@ -0,0 +1,44 @@ +{ stdenv +, lib +, fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "nodenv"; + version = "1.4.0"; + + src = fetchFromGitHub { + owner = "nodenv"; + repo = "nodenv"; + rev = "v${version}"; + sha256 = "0fgc23jd95rjll3dy5hnli8ksfc7rwscw53sdgss4yaharwlg8l2"; + }; + + buildPhase = '' + runHook preBuild + + bash src/configure + make -C src + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r libexec $out/ + cp -r bin $out/ + + runHook postInstall + ''; + + meta = with lib; { + description = "Manage multiple NodeJS versions"; + homepage = "https://github.com/nodenv/nodenv/"; + changelog = "https://github.com/nodenv/nodenv/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ alexnortung ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bcb49b39bae5..6ee899783987 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7341,6 +7341,8 @@ with pkgs; nixnote2 = libsForQt514.callPackage ../applications/misc/nixnote2 { }; + nodenv = callPackage ../development/tools/nodenv { }; + nodejs = hiPrio nodejs-16_x; nodejs-slim = nodejs-slim-16_x;