Skip to content

Commit 2278e9d

Browse files
author
jared
committed
Added devShellHook and devShellTools attributes to
`flake-typescript.nix`
1 parent 1cd1494 commit 2278e9d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

extras/flake-typescript.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ pkgs:
3131
dependencies ? [ ]
3232

3333
, nodejs ? pkgs.nodejs-18_x
34+
, # `devShellHook` is the shell commands to run _before_ entering the shell
35+
# (see the variable `shell`)
36+
devShellHook ? ""
37+
, # `devShellTools` are extra derivations to append to the `buildInputs` for
38+
# the shell (see the variable `shell`)
39+
devShellTools ? [ ]
3440
, ...
3541
}:
3642
let
@@ -143,7 +149,11 @@ let
143149
# Note: `node2nix` sets `$NODE_PATH` s.t. it is a single path.
144150
echo 'Creating a symbolic link from `$NODE_PATH` to `node_modules`...'
145151
ln -snf "$NODE_PATH" node_modules
152+
153+
# Run the provided `devShellHook`
154+
${devShellHook}
146155
'';
156+
buildInputs = node2nixDevelopAttrs.shell.buildInputs ++ devShellTools;
147157
};
148158

149159
# Creates a tarball of `project` using `npm pack` and puts it in the nix

0 commit comments

Comments
 (0)