unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Tobias Geerinckx-Rice <me@tobias.gr>
To: Lo Peter <peterloleungyau@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: How to set global environment variables in Guix System
Date: Sun, 27 Dec 2020 15:39:11 +0100	[thread overview]
Message-ID: <87zh1zqpo0.fsf@nckx> (raw)
In-Reply-To: <CAEM+zmi1Q9u88FphTnbxtGoaX-fs48vTZdZE-aEXvP-MmKm-ag@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

      parent reply	other threads:[~2020-12-27 14:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 13:35 How to set global environment variables in Guix System Lo Peter
2020-12-27 14:07 ` Michael Rohleder
2020-12-27 14:39   ` Tobias Geerinckx-Rice via
2020-12-27 16:22     ` Lo Peter
2020-12-27 14:39 ` Tobias Geerinckx-Rice [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh1zqpo0.fsf@nckx \
    --to=me@tobias.gr \
    --cc=help-guix@gnu.org \
    --cc=peterloleungyau@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).