From 5c78cf0dde607f27c4237a07d7bed19f62e4fca5 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 7 Dec 2020 11:16:59 +0100 Subject: [PATCH] .local/bin/nyxt: Enable options, use system Nyxt for now. --- .local/bin/nyxt | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/.local/bin/nyxt b/.local/bin/nyxt index 25a7fded..7e49a9e5 100755 --- a/.local/bin/nyxt +++ b/.local/bin/nyxt @@ -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 <&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