Subject: [bug#78308] [PATCH v3 10/10] news: Add news entry for etc-bashrc-d-service-type.

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 21 May 2025 09:11:56 +0900

Hi Sergey,

Thanks for the brainstorm / ideas, even patch!

[...]

> I also don't like this idea. Why would non-login shells run
> `/etc/profile.d`? Aren't they launched in environment where login
> happened and therefore `/etc/profile` got applied already?

That's what I initially thought, and I originally didn't see an
immediate need for etc-bashrc-d-service-type, but upon testing with the
/etc/profile.d/vte.sh file installed for example, at least in GNOME
Console it wouldn't take effect.  Perhaps the environment is cleaned up
by GNOME Console and it expects the shell, e.g. Bash, to source
/etc/profile.d/vte.sh from bashrc (GNOME Console starts the shell as an
interactive, non-login shell).  I had tested in an actual VM.

Are you sure that it would help for the flatpak cases (have you actually
tested it?).

Reading flatpak.sh, I assume it would work, as long as flatpak is
installed to the given profile, as it needs to be available on PATH when
/etc/profile is sourced, which should be the case if the snippet is
added below the existing variable exports in ~/.guix-profile/etc/profile
(which contain PATH=).

I'll try taking a look at your snippet.  The guard avoiding double
sourcing /etc/profile looks interesting, perhaps already useful to guard
against bug#23118 for example?

-- 
Thanks,
Maxim