summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
Diffstat (limited to 'Biz')
-rwxr-xr-xBiz/Ide/repl10
1 files changed, 8 insertions, 2 deletions
diff --git a/Biz/Ide/repl b/Biz/Ide/repl
index 2ddbc4b..cf800aa 100755
--- a/Biz/Ide/repl
+++ b/Biz/Ide/repl
@@ -20,28 +20,34 @@ fi
targets=${@:?}
json=$(bild --json ${targets[@]})
langdeps=$(jq --raw-output '.langdeps | join(" ")' <<< $json)
+ sysdeps=$(jq --raw-output '.sysdeps | join(" ")' <<< $json)
exts=$(jq --raw-output '.namespace.ext' <<< $json | sort | uniq)
+ flags=()
+ for lib in ${sysdeps[@]}; do
+ flags+=(--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.${lib}")
+ done
case $exts in
Hs)
if [ -z ${var+PORT} ]; then
echo "warn: repl: ghci does not support binding to a port"
fi
nix-shell \
+ "${flags[@]}" \
--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.ghcWith (h: with h; [$langdeps])" \
--command "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci ${targets[@]}"
;;
Scm)
- flags=()
for lib in ${langdeps[@]}; do
flags+=(--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.guile-${lib}")
done
nix-shell \
+ "${flags[@]}" \
--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.guile_3_0" \
- ${flags[@]} \
--command "guile -L $BIZ_ROOT -C $BIZ_ROOT/_/int --r7rs --listen=${PORT:-37146}"
;;
Lisp)
nix-shell \
+ "${flags[@]}" \
--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.sbclWith (p: with p; [asdf swank $langdeps])" \
--command "sbcl --eval '(require :asdf)' --eval '(require :swank)' --eval '(swank:create-server :port ${PORT:-4005})' --load $targets"
;;