Add wrapper scripts for node / yarn on NixOS.
This commit is contained in:
parent
1967637d98
commit
7671bfd4d3
4 changed files with 23 additions and 0 deletions
10
nix/lib.inc.sh
Normal file
10
nix/lib.inc.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
function wrap() {
|
||||
local TOOL="$1"
|
||||
local REPO="$2"
|
||||
shift
|
||||
shift
|
||||
|
||||
SHELL_NIX="$REPO/shell.nix"
|
||||
QUOTED_ARGS="$(printf "${1+ %q}" "$@")"
|
||||
exec nix-shell "$SHELL_NIX" --pure --command "$TOOL $QUOTED_ARGS"
|
||||
}
|
6
nix/node
Executable file
6
nix/node
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
REPO=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
source "$REPO/nix/lib.inc.sh"
|
||||
|
||||
wrap node "$REPO" "$@"
|
6
nix/yarn
Executable file
6
nix/yarn
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
REPO=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
source "$REPO/nix/lib.inc.sh"
|
||||
|
||||
wrap yarn "$REPO" "$@"
|
|
@ -12,6 +12,7 @@ stdenv.mkDerivation rec {
|
|||
nodejs-16_x
|
||||
rsync
|
||||
sqlite
|
||||
yarn
|
||||
zlib
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue