Skip to content

Instantly share code, notes, and snippets.

@fgaz
Created November 1, 2018 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fgaz/5fa356e61aabbf6cafe5aecfefce34f7 to your computer and use it in GitHub Desktop.
Save fgaz/5fa356e61aabbf6cafe5aecfefce34f7 to your computer and use it in GitHub Desktop.
Enter a nix-shell for developing node packages
#!/usr/bin/env bash
set -e
if [ -e ./node_modules ]; then
echo "please delete node_modules to use this script"
exit 1
fi
function cleanup {
rm -f node_modules
}
trap cleanup EXIT
trap cleanup SIGTERM
nix-shell -p nodePackages.node2nix --run "node2nix -d -8 -l package-lock.json"
nix-shell -A shell --run 'ln -s "${NODE_PATH}" node_modules'
nix-shell -A shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment