-
Notifications
You must be signed in to change notification settings - Fork 0
/
nix-load-lisp.sh
executable file
·19 lines (13 loc) · 1.26 KB
/
nix-load-lisp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env bash
unset NIX_LISP NIX_LISP_ASDF NIX_LISP_ASDF_PATHS NIX_LISP_COMMAND NIX_LISP_EARLY_OPTIONS NIX_LISP_EXEC_CODE NIX_LISP_LD_LIBRARY_PATH NIX_LISP_LOAD_FILE ASDF_OUTPUT_TRANSLATIONS
unset $(set | grep '^_.*NIX_LISP*' | cut -d = -f 1)
export CL_SOURCE_REGISTRY="$(realpath "$(dirname "$0")"):$PWD${CL_SOURCE_REGISTRY:+:}$CL_SOURCE_REGISTRY"
dependencies="drakma dexador puri quri cl_plus_ssl cl-html5-parser parenscript cl-ppcre cl-json css-selectors css-selectors-simple-tree babel cl-unicode bordeaux-threads try clsql local-time ironclad trivial-backtrace $THOUGHTFUL_THERIDION_EXTRA_DEPENDENCIES"
drv="$(nix-instantiate -E "with import <nixpkgs> {}; sbcl.withPackages (ps: with ps; [ $dependencies ] )" --add-root "$THOUGHTFUL_THERIDION_NIX_GC_PIN_DRV")"
test -n "$THOUGHTFUL_THERIDION_NIX_GC_PIN" && nix-store -r "$drv" --add-root "$THOUGHTFUL_THERIDION_NIX_GC_PIN"
path="$(nix-store -r "$drv")"
if test -n "$NO_RLWRAP"; then WRAP=env; else
WRAP="$(nix-build --no-out-link '<nixpkgs>' -A rlwrap)"/bin/rlwrap;
fi
echo "Lisp package: $path" >&2
"$WRAP" "$path"/bin/sbcl --noinform $SBCL_EARLY_OPTIONS --eval "(defparameter common-lisp-user::*argv0* \"$path/bin/sbcl\")" --eval "(require :asdf)" --eval "(asdf:load-system :thoughtful-theridion :verbose nil)" "$@"