Add wrapper scripts for node / yarn on NixOS.
This commit is contained in:
parent
1967637d98
commit
7671bfd4d3
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" "$@"
|
Loading…
Reference in a new issue