Subject: Re: bug#27386: offloading documentation and env

From: [email-masked] (Ludovic Courtès)
Date: Wed, 28 Jun 2017 23:46:20 +0200

ng0 <[email-masked]> skribis:

> I think the method as described never really worked.
>
> When I do as you (and the manual) suggested, I no longer
> have any results for ssh host env | grep "GUILE_".
>
> When I extend it like this it works. I include the full
> paste to show that previously I had the sourcing of /etc/profile
> in it:
>
> user@shadownet ~$ cat .bashrc
> # Bash initialization for interactive non-login shells and
> # for remote shells (info "(bash) Bash Startup Files").
>
> # Export 'SHELL' to child processes.  Programs such as 'screen'
> # honor it and otherwise use /bin/sh.
> export SHELL
>
> if [ -n "$SSH_CLIENT" -a -z "`type -P cat`" ]
> then
>     # We are being invoked from a non-interactive SSH session
>     # (as in "ssh host command") but 'cat' cannot be found
>     # in $PATH.  Source /etc/profile so we get $PATH and other
>     # essential variables.
>     source /etc/profile
> fi
>
> # Adjust the prompt depending on whether we're in 'guix environment'.
> if [ -n "$GUIX_ENVIRONMENT" ]
> then
>     PS1='\u@\h \w [env]\$ '
> else
>     PS1='\u@\h \w\$ '
> fi
> source ~/.guix-profile/etc/profile
> alias ls='ls -p --color'
> alias ll='ls -l'
> GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH}:/run/current-system/profile/lib/guile/2.2/site-ccache:/run/current-system/profile/share/guile/site/2.2"
> GUILE_LOAD_PATH="${GUILE_LOAD_PATH}:/run/current-system/profile/share/guile/site/2.2"

The difference compared to /etc/skel/.bashrc is the last two lines,
right?

On my GuixSD installation they’re not needed because /etc/profile
sources /run/current-system/profile/etc/profile, which already defines
these two variables.

But maybe your global profile is slightly different from mine, which
would explain this.  FWIW I have:

--8<---------------cut here---------------start------------->8---
$ guix package -I gui -p /run/current-system/profile
guix	0.13.0-2.de9d8f0	out	/gnu/store/js4ml3w20ysh4znp9wl0da0ljji4kisl-guix-0.13.0-2.de9d8f0
guile	2.2.2	out	/gnu/store/5zx29y44nrqj0s8h3jlvlj82k8hj4dxs-guile-2.2.2
--8<---------------cut here---------------end--------------->8---

Anyway, if you have ideas on how to improve the doc, they’re welcome.

Thanks for your feedback!

Ludo’.