* adding environment variables to /etc/config.scm
@ 2019-09-02 20:20 Jonathan Lane
2019-09-03 9:27 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Lane @ 2019-09-02 20:20 UTC (permalink / raw)
To: help-guix
Hello,
I have a laptop with Intel graphics and I need to set the environment
variable "COGL_ATLAS_DEFAULT_BLIT_MODE=framebuffer" to fix GPU
corruption issues as described here:
https://wiki.archlinux.org/index.php/Intel_graphics#Troubleshooting
https://bugs.freedesktop.org/show_bug.cgi?id=88584
Unfortunately, it's supposed to go in /etc/environment, and that file
gets clobbered every time I reboot or run `guix system reconfigure`. I
see that $GUIXSRC/gnu/system.scm does some logic to generate that file,
but I don't see an exported variable to manipulate from config.scm like
I do %desktop-services and the like. What is the recommended way to add
global variables here? It has to be a global variable because it alters
the behavior of the X server before gdm starts or my user logs in - I've
tested putting it in .profile and .bashrc to no avail.
Alternatively, this bug is not present on Wayland, so an update to make
gdm run via Wayland by default and expose Wayland sessions would solve
the root problem.
Thanks,
Jonathan Lane
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: adding environment variables to /etc/config.scm
2019-09-02 20:20 adding environment variables to /etc/config.scm Jonathan Lane
@ 2019-09-03 9:27 ` Ludovic Courtès
2019-09-04 2:04 ` Jonathan Lane
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2019-09-03 9:27 UTC (permalink / raw)
To: Jonathan Lane; +Cc: help-guix
Hello Jonathan,
"Jonathan Lane" <jon@dorsal.tk> skribis:
> I have a laptop with Intel graphics and I need to set the environment
> variable "COGL_ATLAS_DEFAULT_BLIT_MODE=framebuffer" to fix GPU
> corruption issues as described here:
>
> https://wiki.archlinux.org/index.php/Intel_graphics#Troubleshooting
> https://bugs.freedesktop.org/show_bug.cgi?id=88584
>
> Unfortunately, it's supposed to go in /etc/environment, and that file
> gets clobbered every time I reboot or run `guix system reconfigure`.
Indeed, on Guix System one is not supposed to modify config files in
place.
Instead, you declare every aspect of your system config in your
‘operating-system’ declaration, and then run ‘reconfigure’ so that it’s
in effect.
To add environment variables to /etc/environment, you would “extend”
‘session-environment-service-type’, like so:
(simple-service 'cogl-variable session-environment-service-type
'(("COGL_ATLAS_DEFAULT_BLIT_MODE" . "framebuffer")))
The expression above provides a service that you can add to the list in
the ‘services’ field of your ‘operating-system’ declaration.
HTH!
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: adding environment variables to /etc/config.scm
2019-09-03 9:27 ` Ludovic Courtès
@ 2019-09-04 2:04 ` Jonathan Lane
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Lane @ 2019-09-04 2:04 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: help-guix
On Tue Sep 3, 2019 at 11:27 AM Ludovic Courtès wrote:
> Hello Jonathan,
> Indeed, on Guix System one is not supposed to modify config files in
> place.
>
> Instead, you declare every aspect of your system config in your
> ‘operating-system’ declaration, and then run ‘reconfigure’ so that it’s
> in effect.
>
> To add environment variables to /etc/environment, you would “extend”
> ‘session-environment-service-type’, like so:
>
> (simple-service 'cogl-variable session-environment-service-type
> '(("COGL_ATLAS_DEFAULT_BLIT_MODE" . "framebuffer")))
>
> The expression above provides a service that you can add to the list in
> the ‘services’ field of your ‘operating-system’ declaration.
>
> HTH!
>
> Ludo’.
This worked perfectly, thanks!
Jonathan
--posted from Guix System, now with working Xorg
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-04 2:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 20:20 adding environment variables to /etc/config.scm Jonathan Lane
2019-09-03 9:27 ` Ludovic Courtès
2019-09-04 2:04 ` Jonathan Lane
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).