nix-config/templates/node/shell.nix

17 lines
336 B
Nix
Raw Normal View History

2023-09-20 13:09:16 +00:00
{ callPackage, writeShellScriptBin }:
let
mainPkg = callPackage ./default.nix { };
npxAlias = name: writeShellScriptBin name "npx ${name} \"$@\"";
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs = [
(npxAlias "tsc")
(npxAlias "tsserver")
] ++ (oa.nativeBuildInputs or [ ]);
shellHook = ''
npm install
'';
})