Ludovic Courtès <[email protected]> writes:

> 宋文武 <[email protected]> skribis:
>
>> Currently, zsh doesn't work out of box.
>
> On the standalone system, right?
Yes.
>
>> IMO, we should use `/etc/environment' for system variables:
>>     LANG=en_US.UTF-8
>>     PATH=/run/current-system/profile/bin:/run/setuid-programs
>> And add `pam_env.so' to /etc/pam.d/login, to make tty login work.
>>
>> With `/etc/profile', `/etc/zlogin' just:
>>     source /etc/environment
>> to make `bash -l' and `zsh -l' work.
>
> Is ‘pam env’ needed at all if /etc/profile and /etc/zlogin are provided
> anyway?
Yes, it's redundant.
Now I think the better way is just provide /etc/environment.
then `bash -l' would take ~/.bash_profile and ~/.profile.
We can have a default ~/.bash_profile like:
    source /etc/environment
    export PATH=$PATH:$HOME/.guix-profile/bin

And install skeletons only when needed by using:
    (operating-system
      (skeletons (list bash-profile)))

WDYT?
>
>> And `~/.bash_profile', `~/.zlogin' for user variables:
>>     [[ $- == *i* ]] && source ~/.bashrc # only for bash
>>     
>>     export PATH=$PATH:$HOME/.guix-profile/bin
>
> OK.  It would be best to have $HOME/.guix-profile/bin in PATH installed
> by /etc/{profile,zlogin}, though, so that it works out of the box.
>
>> Use `~/.bashrc', `~/.zshrc' for interactive settings:
>>     PS1='$ '
>>     alias ls='ls -p --color'
>>     # $(guix package --search-paths)?
>
> OK.
>
> Thanks for the very good summary!  I never had this clear an
> understanding of all this.
In fact, I'm confused about this even now :)
>
> Would you like to submit a patch?  The relevant parts are in (gnu
> system) for /etc/profile, in (gnu system shadow) for the .bashrc
> template, and in (gnu services base) for the PAM settings of the ‘login’
> command.
Sure, I'll try to write a patch, thanks for the direction.
>
> Ludo’.

Reply via email to