Add python and node virtualenvs
This commit is contained in:
parent
9be402f81e
commit
bb7d16565a
5 changed files with 40 additions and 1 deletions
19
node_environment/default.nix
Normal file
19
node_environment/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
with import <nixpkgs> {};
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "myNodeEnv";
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
];
|
||||
src = null;
|
||||
shellHook = ''
|
||||
mkdir -p .npm
|
||||
if [ -s global_packages.txt ]; then
|
||||
cat global_packages.txt | xargs npm install -g --prefix $PWD/.npm
|
||||
fi
|
||||
if [ -s package.json ]; then
|
||||
npm install
|
||||
fi
|
||||
export PATH=$PWD/.npm/bin:$PATH
|
||||
'';
|
||||
}
|
||||
0
node_environment/global_packages.txt
Normal file
0
node_environment/global_packages.txt
Normal file
Loading…
Add table
Add a link
Reference in a new issue