unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: 宋文武 <iyzsong@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: use zsh as login shell
Date: Fri, 05 Dec 2014 19:21:31 +0800	[thread overview]
Message-ID: <87bnnifikk.fsf@gmail.com> (raw)
In-Reply-To: <87oarjqadw.fsf@gnu.org>

Ludovic Courtès <ludo@gnu.org> writes:

> 宋文武 <iyzsong@gmail.com> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> 宋文武 <iyzsong@gmail.com> skribis:
>
> [...]
>
>>>>>   3. The skeleton for ~/.bash_profile sources /etc/profile, /etc/bashrc,
>>>>>      and ~/.bashrc.
>>>>>
>>>>>   4. The definition of PS1 is moved from /etc/profile to /etc/bashrc.
>>>>>
>>>>>   5. The skeleton for ~/.bashrc sources /etc/bashrc.
>>>> It seem too much, what I suggested is:
>>>>     for login, su (pam_env): /etc/environment
>>>>     for login shell:         ~/.bash_profile, ~/.zlogin
>>>>     for interactive:         ~/.bashrc, ~/.zshrc
>>>> skeletons only installed when needed :)
>>>
>>> As a first step, what about always installing the skeletons?  Then we
>>> can see whether/how to refine that.
>
> [...]
>
>> From 1e400957b29a47f63548df39b36a7c0f1d8a37d9 Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
>> Date: Tue, 2 Dec 2014 21:40:52 +0800
>> Subject: [PATCH] gnu: Add /etc/environment.
>>
>> * gnu/system.scm (default-/etc/environment): New procedure.
>>   (etc-directory)[profile]: Remove it.
>>   (etc-directory)[environment]: Add it.
>> * gnu/system/linux.scm (unix-pam-service): Add #:readenv? parameter.
>> * gnu/services/base.scm (mingetty-service): Pass #t as #:readenv?
>>   to unix-pam-service.
>> * gnu/system/shadow.scm (default-skeletons): Add .bash_profile. Adjust .bashrc.
>
> So you ended up choosing pam_env?  I thought we had concluded that it
> wasn’t needed, no?  If it can be avoided, it’s better to do so, IMO.
Ok, I'll take this approach this weekend :)
>
>> +  (mlet %store-monad ((bash-profile (text-file "bash_profile" "\
>> +# honor ~/.bashrc if the shell is interactive
>> +[[ $- == *i* ]] && source ~/.bashrc
>
> I don’t think the test is needed, because ~/.bash_profile is only read
> by interactive Bash.
Yes, I'll do what Mark H Weaver suggest.
>
>> +# load system-wide environment varibales
>> +source /etc/environment
>> +
>> +# common varibales for user profile
>> +export PATH=$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$PATH
>> +export INFOPATH=$HOME/.guix-profile/share/info:$INFOPATH\n"))
>> +                      (bashrc (text-file "bashrc" "\
>> +PS1='\\u@\\h \\w\\$ '
>
> I think PS1 should go to /etc/profile.  WDYT?
+1 for Mark.
>
> Thanks!
>
> Ludo’.

  parent reply	other threads:[~2014-12-05 11:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 15:58 use zsh as login shell 宋文武
2014-11-27 20:15 ` Ludovic Courtès
2014-11-28 15:06   ` 宋文武
2014-11-28 22:26     ` Ludovic Courtès
2014-11-29  3:24       ` 宋文武
2014-12-01 12:57         ` Ludovic Courtès
2014-12-02 14:43           ` 宋文武
2014-12-04 23:10             ` Ludovic Courtès
2014-12-05  5:11               ` Mark H Weaver
2014-12-05 18:54                 ` Ludovic Courtès
2014-12-05 11:21               ` 宋文武 [this message]
2014-12-06  8:04                 ` use zsh and fish " 宋文武
2014-12-06 15:09                   ` Ludovic Courtès
2014-11-28 15:11   ` use zsh " 宋文武
2014-12-05 13:57 ` 宋文武
2014-12-06 22:35   ` /etc/profile and .zshrc skeleton Ludovic Courtès
2014-12-07  4:06     ` 宋文武
2014-12-07 20:35       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnnifikk.fsf@gmail.com \
    --to=iyzsong@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).