Hi Maxim,

Thank you for the fast response. 

I did not understand much the original problem tbh (2015). As I said before I'm 
not a Guix expert so I may be just lost.

For what I can see from the modern discussion of the bug (2022-2023) this is 
non-guix-approach configuration is kept like this just because old GuixSD 
required that?:

CITE:

"Josselin Poiret <dev <at> jpoiret.xyz> writes: 

> Hi Maxim, 
> 
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes: 
> 
>> Just to make sure, remove what exactly? 
>
> Remove the bit in /etc/profile that loads the user's profile, if it is 
> indeed supposed to be loaded by the user's own ~/.zprofile or 
> ~/.bash_profile. 

Remove will break existed systems, so need a NEWS entry as Maxim mentioned, and 
maybe some explainations and examples in the manual about how to setup the 
environments as needed. 

I could make a patch for it this weekend if no one beats me.. 

> At least, I don't know if there is a general agreement 

> on what should be done in /etc/profile vs. the user's own config.

I think hopefully we can agree that /etc/profile only handle the system 
profile, and user's own config can decide what it want.

 Despite mitigation, it still work out of the box with skeletons, and user can 
arrange priorities among profiles, or disable the system one.

 Or configure it via home-shell-profile (TODO: need some changes)."

END OF CITE.

I'm not a Guix developer (yet. I don't feel confident), but I agree with the 
fact that no user env variables should be called or setup in /etc/profile. In 
the Guix spirit doesn't make sense, but even without considering that it also 
does not make sense in the shell spirit, because that's why there is the 
.bash_profile (or equivalent).


Still I don't get why /etc/profile has to contain any user profile env var 
definition.

For example let's say the variable INFOPATH:

My /etc/profile defines:  'export 
INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info'

And my ~/.bash_profile performs: 

eval "$(guix package --search-paths -p $HOME/.config/guix/current -p 
$HOME/.guix-profile ......)"

guix package --search-paths.... eventualy will do "export 
INFOPATH=$HOME/.guix-profile/share/info:$INFOPATH" (or equivalently pointing to 
the gnu/store/....profile/share/info of my user).


And the bash manual says that when starting a login shell first /etc/profile is 
read then .bash_profile is read, in that order and before giving a promt.


Why are we defining INFOPATH (and other paths) for the user in /etc/profile if 
bash automatically will call .bash_profile and do that exact thing?


What is the case that runs a login shell that does not read bash_profile and 
still needs user env var defined? If that's even possible. 

I just don't see the conditions required in which /etc/profile is loaded but 
bash_profile no. And even if that was possible does that make any sense?

That could only happen if there where no users some how, but then why would you 
want to define user env var anyways?


And for me it breaks all the Guix philosophy. At the end guix is transactional 
by modifying each profile environment to a point in time. But if my user 
profile boots with environment variables defined for his environment that are 
setup before his existence then that's contradictory with the fact that each 
profile can travel in time by changing its own environment.

The profile own governance of its instance should be only be performed by 
himself not by a prior system wide configuration.




If I wanted to change that I would probably need to modify guix itself, right?




El 6 de agosto de 2025 2:11:31 UTC, Maxim Cournoyer <[email protected]> 
escribió:
>Hi Marius,
>
>Marius via <[email protected]> writes:
>
>> Good evening,
>>
>>
>> As far as I understand (I'm probably wrong) /etc/profile is the first
>> file loaded on the bash start up when requesting a login shell
>> (interactive or not).
>>
>>
>> At the same time /etc/profile is a system wide "environment
>> configuration file". For me this means that I should initialize env
>> variables that are requires by the current system profile
>> /run/current-system but not anything that is related to any other
>> profile (for example myuser profile ~.guix-profile).
>>
>>
>> What I understand from the Guix concept and bash files is that any env
>> variable (PATHS, etc) that need to configured for a specific user
>> should be inside .bash_profile file.
>>
>>
>> Because of this I don't understand why the /etc/profile includes paths
>> variables that point to the excuting user $HOME. Shouldn't that be in
>> the .bash_profile files? Am I missing something? Maybe the reason
>> because this isn't posible.
>>
>> For example why in my /etc/profile I have the following line:
>>
>> 'export 
>> INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info'
>>
>> It should always work because /etc/profile is only opened with a login
>> shell, but even so it feels a bit weird to have a reference to $HOME
>> inside a system wide bash configuration file. What if for example I
>> changed myuser guix profile name or location from the default one?
>
>I think these are variables we set to ensure the default setup works
>correctly on Guix System. Some variables are set as a workaround to the
>ancient (yet not fully resolved) bug https://bugs.gnu.org/20255, which
>is about the system profile not being merged with the user profile.
>
>-- 
>Thanks,
>Maxim

-- 
Thanks,
Marius.

Reply via email to