unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Initialization of environment variables for guix on foreign distro
@ 2021-12-23  9:29 David Lecompte
  2021-12-24  0:33 ` Thiago Jung Bauermann
  0 siblings, 1 reply; 3+ messages in thread
From: David Lecompte @ 2021-12-23  9:29 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 1199 bytes --]

Hi everyone,

On Trisquel with mate on my laptop, when opening a mate terminal (the
command is just "mate-terminal", no option), all the suitable
environment variables for guix are set.

On Debian with mate on my desktop (I had problems with Trisquel that I
could not solve for one year so I am using Debian), when opening a mate
terminal, the suitable variables for guix are not set.

So I am searching how to fix that on the desktop with Debian.

On both computers, there is /etc/profile.d/guix.sh with the same
contents. On the desktop, "bash -l" sets all the environment variables
properly for guix properly, but I'd like to start programmes installed
by Guix from the mate menu too.

Does guix configure another file to set environment variables properly
or is /etc/profile.d/guix.sh the only one? Is it supposed to be
sufficient to source it via /etc/profile?

If sourcing /etc/profile is supposed to address all cases, what is the
recommended way to have it sourced? (on the laptop, I searched all .*
files in my home directory, none of them is sourcing /etc/profile).
That last question is not guix-specific but any advice is still
welcome.


Thanks,
David.


[-- Attachment #1.2: publickey - david.lecompte@metani.info - 292b3e27.asc --]
[-- Type: application/pgp-keys, Size: 3212 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 855 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Initialization of environment variables for guix on foreign distro
  2021-12-23  9:29 Initialization of environment variables for guix on foreign distro David Lecompte
@ 2021-12-24  0:33 ` Thiago Jung Bauermann
  2021-12-27 10:15   ` David Lecompte
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Jung Bauermann @ 2021-12-24  0:33 UTC (permalink / raw)
  To: help-guix; +Cc: David Lecompte

Hello David,

David Lecompte <david.lecompte@metani.info> writes:
> On Trisquel with mate on my laptop, when opening a mate terminal (the
> command is just "mate-terminal", no option), all the suitable
> environment variables for guix are set.
>
> On Debian with mate on my desktop (I had problems with Trisquel that I
> could not solve for one year so I am using Debian), when opening a mate
> terminal, the suitable variables for guix are not set.

I had a similar issue recently on my Ubuntu laptop, when I switched the
display manager from SDDM to GDM. From what I gather, the latter
launches the desktop session without using a shell so at no point the
shell initialization files are evaluated and thus the environment isn’t set 
up as usual.

I use KDE Plasma, and it has a mechanism to evaluate shell scripts to
set the environment, so in my case to fix the problem what I had to do
was:

$ ln -s /etc/profile ~/.config/plasma-workspace/env/profile.sh

I searched a bit, but unfortunately I couldn’t find an equivalent
solution for MATE.

I suppose one alternative would be to switch from GDM to SDDM. :-)

> Does guix configure another file to set environment variables properly
> or is /etc/profile.d/guix.sh the only one? Is it supposed to be
> sufficient to source it via /etc/profile?

Yes, that should be enough.

> If sourcing /etc/profile is supposed to address all cases, what is the
> recommended way to have it sourced? (on the laptop, I searched all .*
> files in my home directory, none of them is sourcing /etc/profile).
> That last question is not guix-specific but any advice is still
> welcome.

bash automatically reads /etc/profile when invoked as a login shell.
There are more details here:

https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

-- 
Thanks,
Thiago




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Initialization of environment variables for guix on foreign distro
  2021-12-24  0:33 ` Thiago Jung Bauermann
@ 2021-12-27 10:15   ` David Lecompte
  0 siblings, 0 replies; 3+ messages in thread
From: David Lecompte @ 2021-12-27 10:15 UTC (permalink / raw)
  To: Thiago Jung Bauermann, help-guix


[-- Attachment #1.1: Type: text/plain, Size: 2015 bytes --]

Hello Thiago,

Le jeudi 23 décembre 2021 à 21:33 -0300, Thiago Jung Bauermann a
écrit :
> I had a similar issue recently on my Ubuntu laptop, when I switched
> the
> display manager from SDDM to GDM. From what I gather, the latter
> launches the desktop session without using a shell so at no point the
> shell initialization files are evaluated and thus the environment
> isn’t set
> up as usual.
> 
> I use KDE Plasma, and it has a mechanism to evaluate shell scripts to
> set the environment, so in my case to fix the problem what I had to
> do
> was:
> 
> $ ln -s /etc/profile ~/.config/plasma-workspace/env/profile.sh
> 

Thanks for sharing this.

> I searched a bit, but unfortunately I couldn’t find an equivalent
> solution for MATE.
> 

I have a bit of difficulty finding documentation for Mate
unfortunately.

> I suppose one alternative would be to switch from GDM to SDDM. :-)

If using GDM implies that the setup of Guix will not work, I suppose
Guix should consider some improvement to make it work with GDM. I am
not sure GDM is really the problem.

On both computers, I am using lightdm, in my case, lightdm is surely
not the problem (it could be a different configuration of lightdm, I
could dig into lightdm documentation but it seems rather small).

> bash automatically reads /etc/profile when invoked as a login shell.
> There are more details here:
> 
>  
> https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
> 

Yes and I can confirm it works.

That said, a mechanism to always invoke bash as login shell could have
side effects that I may find only much later. Or, after an upgrade,
that mechanism may stop working, or create other problems, and I could
have forgotten what I did manually.

Perhaps the problem even comes because of something I did manually and
can't remember.

If anyone is using Guix with Debian 11 and Mate, I am interested to
know whether that problem exists or not.

David.


[-- Attachment #1.2: publickey - david.lecompte@metani.info - 292b3e27.asc --]
[-- Type: application/pgp-keys, Size: 3212 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 855 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-27 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23  9:29 Initialization of environment variables for guix on foreign distro David Lecompte
2021-12-24  0:33 ` Thiago Jung Bauermann
2021-12-27 10:15   ` David Lecompte

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).