ambevar-dotfiles/.local/bin/nyxt

65 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
_guix_profile=$HOME/.guix-temp-profiles/nyxt/nyxt
[ -e "$_guix_profile" ] && source "$_guix_profile"/etc/profile
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: 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$' \
--expose=/etc/ssl/certs \
--expose="$HOME/.config/nyxt/" \
--expose="$HOME/common-lisp/" \
--expose="$HOME/.emacs.d/init.el" \
--expose="$HOME/.emacs.d/lisp/" \
--expose="$PERSONAL/bookmarks/engines.el" \
--expose="$HOME/.gnupg/gpg.conf" \
--expose="$HOME/.gnupg/gpg-agent.conf" \
--expose="$HOME/.gnupg/" \
--share="$(gpgconf --list-dirs | grep socketdir | cut -f2 -d:)" \
--share="$HOME/.local/share/nyxt/" \
--share="$PERSONAL/bookmarks/bookmarks.lisp.gpg" \
--share="$PERSONAL/bookmarks/auto-mode-rules.lisp.gpg" \
--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