.local/bin/nyxt: Enable options, use system Nyxt for now.

master
Pierre Neidhardt 2020-12-07 11:16:59 +01:00
parent a3388cb728
commit 5c78cf0dde
1 changed files with 34 additions and 3 deletions

View File

@ -1,14 +1,44 @@
#!/bin/sh
exec ~/.guix-extra-profiles/main/main/bin/nyxt "$@"
# exec ~/common-lisp/nyxt/nyxt "$@"
## Symlinks are not followed, so we must make sure to expose them directly and
## not just the parent directory.
## TODO: Because SBCL does not store its strings in UTF-8, grafting fails.
## Workaround: enable --no-grafts or share the store.
## TODO: Option to build from source.
## TODO: Share download folder.
## TODO: Set --no-cwd.
usage () {
cat <<EOF>&2
Usage: ${0##*/} [NYXT-ARGS]
Start Nyxt in a container.
Options:
-s MANIFEST: Start Nyxt from source using the provided manifest.
EOF
}
executable=nyxt
opt_from="nyxt"
while getopts ":s:" opt; do
case $opt in
s)
executable=sbcl
opt_from_source="-l '$OPTARG'" ;;
h)
usage
exit 0;;
\?)
usage
exit 1 ;;
esac
done
guix environment --no-grafts --container --network \
--preserve='^PERSONAL$' --preserve='^DISPLAY$' \
@ -25,8 +55,9 @@ guix environment --no-grafts --container --network \
--share="$HOME/.local/share/nyxt/" \
--share="$PERSONAL/bookmarks/bookmarks.lisp.gpg" \
--share="$PERSONAL/bookmarks/auto-mode-rules.lisp.gpg" \
--ad-hoc gnupg nss-certs nyxt -- nyxt "$@"
--ad-hoc gnupg nss-certs $opt_from -- $executable "$@"
## TODO: Fix fonts.
# --expose="$HOME/.guix-profile/" \
# fontconfig font-dejavu --ad-hoc fontconfig font-dejavu nss-certs nyxt coreutils -- nyxt "$@"
# Try using --link-profile