-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce preInstallCustomCommands attribute for node modules
preInstallCustomCommands allows to run arbitrary shell scripts, running per node module pinned to given version - such approach, allows for fixing node modules which would otherwise be unfit for running on NixOS
- Loading branch information
1 parent
7a321e2
commit 525b97c
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,21 @@ npmlock2nix.node_modules { | |
# }; | ||
# }; | ||
# You can run arbitrary shell operation for given module in given version, | ||
# using preInstallCustomCommands attribute. Below you see how you can | ||
# override path to esbuild module, depending on which version in needed. | ||
# This approach comes in handy, if node_modules have two competing versions | ||
# of the same module. | ||
# Please note: set key must adhere to the pattern <module_name>@<module_version>. | ||
# preInstallCustomCommands = { | ||
# "[email protected]" = ['' | ||
# sed -i -e 's|process.env.ESBUILD_BINARY_PATH|"${esbuild_0_8_57}/bin/esbuild"|g' ./install.js | ||
# '']; | ||
# "[email protected]" = ['' | ||
# sed -i -e 's|process.env.ESBUILD_BINARY_PATH|"${esbuild_0_11_12}/bin/esbuild"|g' ./install.js | ||
# '']; | ||
# }; | ||
# You can set any desired environment by just adding them to this set just | ||
# like you would do in a regular `stdenv.mkDerivation` invocation: | ||
# MY_ENVIRONMENT_VARIABLE = "foo"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters