Skip to content

Commit

Permalink
Replace npmCmd parameter with installCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkecan committed Sep 26, 2021
1 parent e07031b commit 8f382b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `node_modules` function takes an attribute set with the following attributes
- **packageJson** *(default `src+"/package.json"`)*: Path to `package.json`
- **packageLockJson** *(default `src+"/package-lock.json"`)*: Path to `package-lock.json`
- **nodejs** *(default `nixpkgs.nodejs`, which is the Active LTS version)*: Node.js derivation to use
- **npmCmd** *(default `npm install --offline`)*: npm command to install dependencies
- **installCommands** *(default `[ "npm install --offline --nodedir=${nodeSource nodejs}" ]`)*: List of commands to install dependencies.
- **preInstallLinks** *(default `{}`)*: Map of symlinks to create inside npm dependencies in the `node_modules` output (See [Concepts](#concepts) for details).
- **githubSourceHashMap** *(default `{}`)*: Dependency hashes for evaluation in restricted mode (See [Concepts](#concepts) for details).

Expand Down
4 changes: 2 additions & 2 deletions internal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ rec {
, buildInputs ? [ ]
, nativeBuildInputs ? [ ]
, nodejs ? default_nodejs
, npmCmd ? "npm install --offline"
, installCommands ? [ "npm install --offline --nodedir=${nodeSource nodejs}" ]
, preBuild ? ""
, postBuild ? ""
, preInstallLinks ? { } # set that describes which files should be linked in a specific packages folder
Expand Down Expand Up @@ -386,7 +386,7 @@ rec {
declare -pf > $TMP/preinstall-env
ln -s ${preinstall_node_modules}/node_modules/.hooks/prepare node_modules/.hooks/preinstall
export HOME=.
${npmCmd} --nodedir=${nodeSource nodejs}
${lib.concatStringsSep "\n" installCommands}
test -d node_modules/.bin && patchShebangs node_modules/.bin
rm -rf node_modules/.hooks
runHook postBuild
Expand Down

0 comments on commit 8f382b6

Please sign in to comment.