From fb8c172b041d98af77a3186466c31a6bb16f7c89 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 30 Dec 2023 14:45:56 +0530 Subject: [PATCH] add devshell for nodejs --- flake.nix | 1 + shells/node.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 shells/node.nix diff --git a/flake.nix b/flake.nix index c82f5b8..4341729 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ haskell = import ./shells/haskell.nix { inherit pkgs; }; python = import ./shells/python.nix { inherit pkgs; }; rust = import ./shells/rust.nix { inherit pkgs; }; + node = import ./shells/node.nix { inherit pkgs; }; }; } ); diff --git a/shells/node.nix b/shells/node.nix new file mode 100644 index 0000000..4683d29 --- /dev/null +++ b/shells/node.nix @@ -0,0 +1,11 @@ +{ pkgs }: pkgs.mkShell { + packages = with pkgs; [ + nodejs_20 + yarn + ]; + shellHook = '' + export npm_config_prefix="$PWD/.nix/npm/prefix" + export npm_config_cache="$PWD/.nix/npm/cache" + export PATH="$npm_config_prefix/bin:$PATH" + ''; +}