help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set global environment variables in Guix System


From: Tobias Geerinckx-Rice
Subject: Re: How to set global environment variables in Guix System
Date: Sun, 27 Dec 2020 15:39:11 +0100

Peter!

Lo Peter 写道:
~/.pam_environment

I don't think we configure PAM to look at this by default. I'm not sure why GDM doesn't load ~/.profile (it may be right not to -- most of these files are abused). I'd never heard of ~/.xprofile.

Any help is greatly appreciated. Also, I think a way to let user
customize /etc/environment through the system config will be useful,
but I do not find a way to do so.

That already exists, but it seems to be wholly undocumented(?). Boo.

Also, IIRC blindly plonking

 (session-environment-service-type '(("FOO" . "bar")))

into your services would only get you the ‘duplicate service’ error. It's meant to be extended.

First, define this in your system.scm (above your operating-system):

 (define environment-service-type
   (service-type (name 'environment)
                 (default-value '())
                 (extensions
                  (list (service-extension
                         session-environment-service-type
                         identity)))))

Then use it in your services field:

 (service environment-service-type
          '(("GTK_IM_MODULE" . "ibus")
            ("QT_IM_MODULE" . "ibus")
            ...))

I hope that helps,

T G-R

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]