nix-config/templates/node/shell.nix
2023-09-20 09:09:16 -04:00

16 lines
336 B
Nix

{ 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
'';
})