bash
source /etc/profile.d/ge_interactive-environment.sh
echo "Your RStudio instance awaits you at http://$(hostname -f):${SGE_INTERACT_PORT}" | \
mail -s "RStudio instance started for Job ${JOB_ID} (${JOB_NAME})" ${USER}
/gnu/remote/bin/guix shell \
--container --network \
--no-cwd \
--share="/gnu/store" \
--expose="/etc/profile.d" \
--expose="/fast" \
--preserve=LANG \
--manifest=/gnu/remote/manifests/rstudio-server.scm \
$@ \
-- \
/bin/sh -c \
'export SSL_CERT_PATH="$GUIX_ENVIRONMENT/etc/ssl/certs"; \
export SSL_CERT_FILE="$SSL_CERT_PATH/ca-certificates.crt"; \
export GUIX_LOCPATH="$GUIX_ENVIRONMENT/lib/locale"; \
source /etc/profile.d/ge_interactive-environment.sh; \
env > ~/.Renviron; \
'"rserver --database-config-file=<(echo -e 'provider=sqlite\ndirectory=$HOME/rstudio-server-db') \
--auth-none=1 \
--www-address=${HOSTNAME} \
--www-port=${SGE_INTERACT_PORT} \
--server-user=${USER} \
--server-data-dir=${TMPDIR}/${USER}-${SGE_INTERACT_PORT}-rserver-data \
--secure-cookie-key-file=${TMPDIR}/${USER}-${SGE_INTERACT_PORT}-secure-cookie-key"