Dear Guix,

I'm stuck and could use some advice. I have R scripts which use the httr2 R package (r-httr2) to make HTTP calls. These scripts do not run out of the box inside a guix environment created by guix shell because R makes the wrong assumption by default about where the web certificates are. After reading the mailing list and the info manual, I found a kludge workaround where I can define CURL_CA_BUNDLE environment variable inside of R relying on GUIX_ENVIRONMENT. Now I'm looking for a less tedious and more automated way of setting that environment variable. I would prefer to have a single shell script which sets up my guix environment setting that environment variable. Right now, I have a list of commands which works.

$ CUSTOM_EMACS=$HOME/path/to/custom-configuration-with-necessary-R-packages
$ cd $CUSTOM_EMACS
$ guix shell -m manifest.scm # interactively the next two lines run inside of this shell $ export CURL_CA_BUNDLE="$GUIX_ENVIRONMENT/etc/ssl/certs/ca-certificates.crt"
$ emacs --init-directory="$CUSTOM_EMACS"

Since the guix shell command takes control of the process, the last two lines cannot be run in a script. What is an intuitive way to make the shell do the same thing as I would do interactively? I'm guessing there are some shell scripting concepts I am overlooking. However, I am hoping this sort of issue is so common that there is a solution which is also intuitive.

Thanks,
Kyle

Reply via email to