Hi David Thompson, Thanks for your response, guess I'll have to use envstore or or create file I can source into my current shell session.
I was just curious if there was a way to accomplish that from guix. And thanks for the example link. Thanks, -- Matthew Jordan Sent with my mu4e Thompson, David writes: > On Wed, May 18, 2016 at 2:24 PM, Matthew Jordan > <matthewjordandev...@yandex.com> wrote: >> Good Day everyone, >> >> I would like to know is it possible to set any environment variable to >> any value from guix package. The usecase I am thinking of is for a >> project. Let's say you had a guix package file to automate and document >> project dependencies. >> >> Let's say I wanted to declare a variable in project package file so that >> "eval `guix environment --search-paths ...`" would set up the >> environment with the needed variables plus the ones I wanted. >> >> Example environment variable; >> >> export MSG='Hello world!' > > See the 'native-search-paths' field of package objects. From > environment variables that aren't search paths, like the above $MSG, > those have nothing to do with packages so they wouldn't need to use > anything from Guix at all. > > Also, why the use of 'eval' here? Just 'guix environment my-package' > would spawn a shell (or any program you wanted) with access to the > package's dependencies. > > I use this all the time in my personal projects, where I keep a > 'guix.scm' file in the root of the source tree that I can make > environment's from like so: > > guix environment -l guix.scm > > Additionally, I can also build and/or install development snapshots: > > guix build -f guix.scm > guix package -f guix.scm > > Here's a full example: > > https://git.dthompson.us/haunt.git/blob/HEAD:/guix.scm > > Hope this helps! > > - Dave