Based on the Nix expression from https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/node/build-npm-package/default.nix, the buildNpmPackage
function takes the following fields as inputs:
name
: The name of the package. It defaults to a combination ofpname
andversion
fromargs
.src
: The source of the package if it's a single source. Defaults tonull
.srcs
: The sources of the package if there are multiple. Defaults tonull
.sourceRoot
: The root directory of the source. Defaults tonull
.prePatch
: Commands to run before applying patches. Defaults to an empty string.patches
: A list of patches to be applied to the source. Defaults to an empty list.postPatch
: Commands to run after applying patches. Defaults to an empty string.nativeBuildInputs
: A list of native build dependencies. Defaults to an empty list.buildInputs
: A list of build dependencies. Defaults to an empty list.npmDepsHash
: The output hash of the dependencies for the project. It can be calculated in advance withprefetch-npm-deps
. Defaults to an empty string.forceGitDeps
: Whether to force the usage of Git dependencies that have install scripts but not a lockfile. Use with care. Defaults tofalse
.makeCacheWritable
: Whether to make the cache writable prior to installing dependencies. Defaults tofalse
.npmBuildScript
: The script to run to build the project. Defaults to"build"
.npmFlags
: Flags to pass to all npm commands. Defaults to an empty list.npmInstallFlags
: Flags to pass tonpm ci
. Defaults to an empty list.npmRebuildFlags
: Flags to pass tonpm rebuild
. Defaults to an empty list.npmBuildFlags
: Flags to pass tonpm run ${npmBuildScript}
. Defaults to an empty list.npmPackFlags
: Flags to pass tonpm pack
. Defaults to an empty list.npmPruneFlags
: Flags to pass tonpm prune
. Defaults to the same asnpmInstallFlags
.npmWorkspace
: Value for npm--workspace
flag and directory in which the files to be installed are found. Defaults tonull
.