* Setting environment variables for nix service @ 2020-08-04 13:34 dario 2020-08-05 14:08 ` Oleg Pykhalov 0 siblings, 1 reply; 4+ messages in thread From: dario @ 2020-08-04 13:34 UTC (permalink / raw) To: help-guix Hello, I am a bit confused about how to correctly set up the nix service. Following the steps in http://guix.gnu.org/manual/en/guix.html#index-Nix , the last step is to run source /run/current-system/profile/etc/profile.d/nix.sh which takes care about setting the environment variables correctly. I am trying to run this command should be run automatically at login. Two questions: 1. What is the proper way to do this? I am using gdm and exwm, and adding the line to any of ~/.profile, ~/.xprofile, ~/.zprofile, or ~/.bash_profile does not seem to have any effect in exwm. 2. Couldn't the nix service take care of this automatically? I'd be happy to contribute a corresponding path once I have the answer to my first question. Best regards, Dario ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Setting environment variables for nix service 2020-08-04 13:34 Setting environment variables for nix service dario @ 2020-08-05 14:08 ` Oleg Pykhalov 2020-08-06 15:47 ` dario 0 siblings, 1 reply; 4+ messages in thread From: Oleg Pykhalov @ 2020-08-05 14:08 UTC (permalink / raw) To: dario; +Cc: help-guix [-- Attachment #1: Type: text/plain, Size: 745 bytes --] Hi, dario <dario.klingenberg@web.de> writes: > Two > questions: > > 1. What is the proper way to do this? I am using gdm and exwm, and > adding the line to any of ~/.profile, ~/.xprofile, ~/.zprofile, or > ~/.bash_profile does not seem to have any effect in exwm. Probably GDM doesn't read those files by design. Could you try ‘~/.bashrc’, please? > 2. Couldn't the nix service take care of this automatically? I'd be > happy to contribute a corresponding path once I have the answer to my > first question. Probably yes, and the patch is welcome! ;-) Just one consideration - I think it should be optional, in case the automation will brake because of Nix update or highly customized system. Regards, Oleg. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Setting environment variables for nix service 2020-08-05 14:08 ` Oleg Pykhalov @ 2020-08-06 15:47 ` dario 2020-08-08 15:09 ` Setting environment variables for nix service [SOLVED] dario 0 siblings, 1 reply; 4+ messages in thread From: dario @ 2020-08-06 15:47 UTC (permalink / raw) To: Oleg Pykhalov; +Cc: help-guix Hi, thanks for your input! > Could you try ‘~/.bashrc’, please? In that case, emacs still doesn't recognize the new environment variables, but of course, any terminals I start withing exwm do. Still, this doesn't really solve the problem. Anyway, I am currently working around the issue by setting the variables manually in my init.el using setenv, but I would still be interested in learning the proper way to set environment variables in a gdm+exwm-setting. By the way, ~/.bash_profile does get read, and I can e.g. autostart programs by putting the respective commands in ~/.bash_profile. However, environment variables set in ~/.bash_profile are not recognized by emacs. Regarding my second question, it seems that the nix service is already setting some of the nix-specific environment variables, but doesn't change general ones such as $PATH. So maybe the feature I suggested is already implemented, but they took care not change $PATH by default because of the reason you mentioned. Cheers, Dario Oleg Pykhalov <go.wigust@gmail.com> writes: > Hi, > > dario <dario.klingenberg@web.de> writes: > >> Two >> questions: >> >> 1. What is the proper way to do this? I am using gdm and exwm, >> and >> adding the line to any of ~/.profile, ~/.xprofile, ~/.zprofile, >> or >> ~/.bash_profile does not seem to have any effect in exwm. > > Probably GDM doesn't read those files by design. > > Could you try ‘~/.bashrc’, please? > >> 2. Couldn't the nix service take care of this automatically? >> I'd be >> happy to contribute a corresponding path once I have the answer >> to my >> first question. > > Probably yes, and the patch is welcome! ;-) Just one > consideration - I > think it should be optional, in case the automation will brake > because > of Nix update or highly customized system. > > Regards, > Oleg. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Setting environment variables for nix service [SOLVED] 2020-08-06 15:47 ` dario @ 2020-08-08 15:09 ` dario 0 siblings, 0 replies; 4+ messages in thread From: dario @ 2020-08-08 15:09 UTC (permalink / raw) To: help-guix Hi, apparently, the issue was related to emacs (I am using doom emacs) setting environment variables after startup. Removing ~/.emacs.d/.local/env solved the issue, so this is not really related to guix - sorry. Best Dario dario <dario.klingenberg@web.de> writes: > Hi, > > > thanks for your input! > >> Could you try ‘~/.bashrc’, please? > > In that case, emacs still doesn't recognize the new environment > variables, but of course, any terminals I start withing exwm do. > Still, > this doesn't really solve the problem. Anyway, I am currently > working > around the issue by setting the variables manually in my init.el > using > setenv, but I would still be interested in learning the proper > way to > set environment variables in a gdm+exwm-setting. > > By the way, ~/.bash_profile does get read, and I can e.g. > autostart > programs by putting the respective commands in ~/.bash_profile. > However, > environment variables set in ~/.bash_profile are not recognized > by emacs. > > Regarding my second question, it seems that the nix service is > already > setting some of the nix-specific environment variables, but > doesn't > change general ones such as $PATH. So maybe the feature I > suggested is > already implemented, but they took care not change $PATH by > default > because of the reason you mentioned. > > > Cheers, > > Dario > > > Oleg Pykhalov <go.wigust@gmail.com> writes: > >> Hi, >> >> dario <dario.klingenberg@web.de> writes: >> >>> Two >>> questions: >>> >>> 1. What is the proper way to do this? I am using gdm and exwm, >>> and >>> adding the line to any of ~/.profile, ~/.xprofile, >>> ~/.zprofile, or >>> ~/.bash_profile does not seem to have any effect in exwm. >> >> Probably GDM doesn't read those files by design. >> >> Could you try ‘~/.bashrc’, please? >> >>> 2. Couldn't the nix service take care of this automatically? >>> I'd be >>> happy to contribute a corresponding path once I have the >>> answer to my >>> first question. >> >> Probably yes, and the patch is welcome! ;-) Just one >> consideration - I >> think it should be optional, in case the automation will brake >> because >> of Nix update or highly customized system. >> >> Regards, >> Oleg. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-08 15:09 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-08-04 13:34 Setting environment variables for nix service dario 2020-08-05 14:08 ` Oleg Pykhalov 2020-08-06 15:47 ` dario 2020-08-08 15:09 ` Setting environment variables for nix service [SOLVED] dario
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).