doc: Add documentation on nodejsInstallExecutables

This commit is contained in:
Ross Smyth
2026-02-04 18:19:31 -05:00
parent d76f3f1741
commit 471dfbe96c
4 changed files with 53 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ libxml2.section.md
meson.section.md
mpi-check-hook.section.md
ninja.section.md
nodejs-install-executables.section.md
npm-build-hook.section.md
npm-config-hook.section.md
npm-install-hook.section.md

View File

@@ -0,0 +1,29 @@
# nodejsInstallExecutables {#nodejs-install-executables}
Hook for wrapping Node.js executables.
Primarily created for a multi-language environment.
## Examples {#nodejs-install-executables-example}
[](#npm-build-hook-example-snippet)
## Variables controlling `nodejsInstallExecutables` {#nodejs-install-executables-variables}
### `nodejsInstallExecutables` Exclusive Variables {#nodejs-install-executables-exclusive-variables}
#### `makeWrapperArgs` {#nodejs-install-executables-wrapper-args}
Flags to pass to the call to [`makeWrapper`](#fun-makeWrapper).
To avoid double-wrapping, this flag can also be accessed in Bash.
```nix
stdenv.mkDerivation (finalAttrs: {
#...
dontWrapGApps = true;
postInstall = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
#...
})
```

View File

@@ -14,6 +14,7 @@ Hook for building packages that use npm. Can be used in multi-language environme
fetchFromGitHub,
fetchNpmDeps,
npmHooks,
nodejsInstallExecutables,
nodejs,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -31,6 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
nodejs
nodejsInstallExecutables
npmHooks.npmConfigHook
npmHooks.npmBuildHook
npmHooks.npmInstallHook
@@ -51,11 +53,16 @@ stdenv.mkDerivation (finalAttrs: {
hash = "...";
};
makeWrapperArgs = [
"--set"
"NODE_ENV"
"production"
];
meta = {
description = "npm project";
};
})
```
:::

View File

@@ -203,6 +203,21 @@
"no-broken-symlinks.sh": [
"index.html#no-broken-symlinks.sh"
],
"nodejs-install-executables": [
"index.html#nodejs-install-executables"
],
"nodejs-install-executables-example": [
"index.html#nodejs-install-executables-example"
],
"nodejs-install-executables-exclusive-variables": [
"index.html#nodejs-install-executables-exclusive-variables"
],
"nodejs-install-executables-variables": [
"index.html#nodejs-install-executables-variables"
],
"nodejs-install-executables-wrapper-args": [
"index.html#nodejs-install-executables-wrapper-args"
],
"nostrictaliasing": [
"index.html#nostrictaliasing"
],