File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
# if using nixos, run `use flake`
2
2
if has nix; then
3
3
use flake
4
- else
4
+ else
5
5
# Check if nvm is installed, install if not
6
6
if [ ! -d " $NVM_DIR " ] || [ ! -s " $NVM_DIR /nvm.sh" ]; then
7
7
echo " nvm is not installed. Installing nvm..."
8
-
8
+
9
9
# Install nvm
10
10
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
11
11
fi
19
19
20
20
# install node version from .nvmrc
21
21
nvm install
22
- fi
23
22
24
- # enable pnpm in corepack
25
- corepack enable pnpm
23
+ # enable pnpm in corepack
24
+ corepack enable pnpm
26
25
27
- # install package manager with corepack (from package.json#packageManager)
28
- corepack install
26
+ # install package manager with corepack (from package.json#packageManager)
27
+ corepack install
28
+ fi
29
29
30
30
# install dependencies
31
31
pnpm install
Original file line number Diff line number Diff line change 16
16
pkgs = import nixpkgs {
17
17
inherit system ;
18
18
} ;
19
- node-toolchain = with pkgs ; [
20
- nodejs
21
- nodePackages . pnpm
22
- ] ;
19
+ pnpm-shim = pkgs . writeShellScriptBin "pnpm" ''
20
+ #! ${ pkgs . bash } /bin/bash
21
+ exec ${ pkgs . lib . getBin pkgs . nodejs_20 } /bin/node ${ pkgs . lib . getBin pkgs . nodejs_20 } /bin/corepack pnpm "$@"
22
+ '' ;
23
23
in
24
24
{
25
25
devShell = pkgs . mkShell {
26
26
shellHook = ''
27
27
export PATH="$PATH:$(git rev-parse --show-toplevel)/node_modules/.bin"
28
28
'' ;
29
29
buildInputs = with pkgs ; [
30
- node-toolchain
30
+ nodejs_20
31
+ corepack_20
32
+ pnpm-shim
31
33
] ;
32
34
} ;
33
35
} ) ;
You can’t perform that action at this time.
0 commit comments