From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: use zsh as login shell Date: Fri, 05 Dec 2014 19:21:31 +0800 Message-ID: <87bnnifikk.fsf@gmail.com> References: <87k32gtz2p.fsf@gmail.com> <87mw7cjt7b.fsf@gnu.org> <87mw7b74ar.fsf@gmail.com> <8761dzynah.fsf@gnu.org> <87vblyy9ia.fsf@gmail.com> <87egsjcyst.fsf@gnu.org> <87wq6aun7b.fsf@gmail.com> <87oarjqadw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwqxQ-0005Jb-GP for guix-devel@gnu.org; Fri, 05 Dec 2014 06:22:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwqxL-0000Et-1B for guix-devel@gnu.org; Fri, 05 Dec 2014 06:21:56 -0500 In-Reply-To: <87oarjqadw.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s writes: > =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > >> Ludovic Court=C3=A8s writes: >> >>> =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > > [...] > >>>>> 3. The skeleton for ~/.bash_profile sources /etc/profile, /etc/bash= rc, >>>>> 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: =3D?UTF-8?q?=3DE5=3DAE=3D8B=3DE6=3D96=3D87=3DE6=3DAD=3DA6?=3D >> 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=E2=80=99t needed, no? If it can be avoided, it=E2=80=99s 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 >> +[[ $- =3D=3D *i* ]] && source ~/.bashrc > > I don=E2=80=99t 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=3D$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$PATH >> +export INFOPATH=3D$HOME/.guix-profile/share/info:$INFOPATH\n")) >> + (bashrc (text-file "bashrc" "\ >> +PS1=3D'\\u@\\h \\w\\$ ' > > I think PS1 should go to /etc/profile. WDYT? +1 for Mark. > > Thanks! > > Ludo=E2=80=99.