From 7dd2fccd5f1d5ddefa18e9a25c16724ceb54a909 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 20 Jul 2022 10:24:04 -0400 Subject: Provision scheme environments with nix There's no `guileWith` in nixpkgs, so I think I just need to pass multiple `--packages` flags. I can't test this yet because I need to implement import detection in Bild.hs first, but that's less important because Guile ships with a bunch of SRFIs, which is nice, and anyway there aren't many Guile libraries in nixpkgs for me to pull from. --- Biz/Ide/repl | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Biz/Ide/repl b/Biz/Ide/repl index 7c2e15c..dfd8c3d 100755 --- a/Biz/Ide/repl +++ b/Biz/Ide/repl @@ -14,18 +14,24 @@ exts=$(jq --raw-output '.namespace.ext' <<< $json | sort | uniq) case $exts in Hs) - nix-shell \ - --packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.ghcWith (h: with h; [$langdeps])" \ - --command "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci ${targets[@]}" + nix-shell \ + --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) - echo "scheme repl not supported yet: $target" - exit 1 + flags=() + for lib in ${langdeps[@]}; do + flags+=(--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.guile-${lib}") + done + nix-shell \ + --packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.nixpkgs.guile_3_0" \ + ${flags[@]} \ + --command "guile -L $BIZ_ROOT -C $BIZ_ROOT/_/int --r7rs --listen" ;; Lisp) nix-shell \ --packages "(import $BIZ_ROOT/Biz/Bild.nix {}).private.sbclWith (p: with p; [asdf swank $langdeps])" \ - --run "sbcl --eval '(require :asdf)' --eval '(require :swank)' --eval '(swank:create-server)' --load $targets" + --command "sbcl --eval '(require :asdf)' --eval '(require :swank)' --eval '(swank:create-server)' --load $targets" ;; *) echo "unsupported targets: ${targets[@]}" -- cgit v1.2.3