mbox series

[bug#60365,0/4] Rationalize 'PS1' handling in home, system, and shell

Message ID 20221227212342.17939-1-ludo@gnu.org
Headers show
Series Rationalize 'PS1' handling in home, system, and shell | expand

Message

Ludovic Courtès Dec. 27, 2022, 9:23 p.m. UTC
Hello!

I found some things could be improved in how we deal with ‘PS1’ in
Guix Home, Guix System, and ‘guix shell’ (my initial motivation was
making it easy to change ‘PS1’ from a Home configuration).

These patches fiddle with ‘PS1’.  The most visible effect is that
Guix Home’s ~/.bashrc will no longer provide a default ‘PS1’.

Thoughts?

Ludo’.

Ludovic Courtès (4):
  system, home: Factorize default '.bashrc'.
  system: Define default 'PS1' in /etc/bashrc rather than ~/.bashrc.
  environment: Simplify 'PS1' suggestion on '--check'.
  environment: Avoid false positive on 'PS1' check.

 gnu/home/services/shells.scm | 41 +++---------------------------------
 gnu/system.scm               |  3 +++
 gnu/system/shadow.scm        | 33 +++++++++++++----------------
 guix/scripts/environment.scm | 12 ++++++-----
 4 files changed, 28 insertions(+), 61 deletions(-)


base-commit: 9369c1ccf47d9bf6f2e28a9454c1c329a2044f19
prerequisite-patch-id: aae3af39aa7753dd7ed6d0584587a06d51402386

Comments

Andrew Tropin Dec. 28, 2022, 7:23 a.m. UTC | #1
On 2022-12-27 22:23, Ludovic Courtès wrote:

> Hello!
>

Hi Ludovic!

> I found some things could be improved in how we deal with ‘PS1’ in
> Guix Home, Guix System, and ‘guix shell’ (my initial motivation was
> making it easy to change ‘PS1’ from a Home configuration).
>
> These patches fiddle with ‘PS1’.  The most visible effect is that
> Guix Home’s ~/.bashrc will no longer provide a default ‘PS1’.
>
> Thoughts?

Factorization of bashrc is great!

Not sure about moving PS1 to /etc/bashrc as it won't work on foreign
distros and guix environment won't be noticable in the prompt.  Warning
is useful, but I would expect prompt work OOB, when guix-defualts? is
#t.

The possible alternative solution is to factorize bash_profile and put
PS1 here, so both skeleton and home provided bashrc have it, after that
setting PS1 with environment-variables field will start working.

>
> Ludo’.
>
> Ludovic Courtès (4):
>   system, home: Factorize default '.bashrc'.
>   system: Define default 'PS1' in /etc/bashrc rather than ~/.bashrc.
>   environment: Simplify 'PS1' suggestion on '--check'.
>   environment: Avoid false positive on 'PS1' check.
>
>  gnu/home/services/shells.scm | 41 +++---------------------------------
>  gnu/system.scm               |  3 +++
>  gnu/system/shadow.scm        | 33 +++++++++++++----------------
>  guix/scripts/environment.scm | 12 ++++++-----
>  4 files changed, 28 insertions(+), 61 deletions(-)
>
>
> base-commit: 9369c1ccf47d9bf6f2e28a9454c1c329a2044f19
> prerequisite-patch-id: aae3af39aa7753dd7ed6d0584587a06d51402386