unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Question about package environment variables
@ 2016-05-18 18:24 Matthew Jordan
  2016-05-18 18:33 ` Thompson, David
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Jordan @ 2016-05-18 18:24 UTC (permalink / raw)
  To: Help Guix

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!'

Thanks in advance for any help or info.

Sincerely,

-- 
Matthew Jordan
Sent with my mu4e

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about package environment variables
  2016-05-18 18:24 Question about package environment variables Matthew Jordan
@ 2016-05-18 18:33 ` Thompson, David
  2016-05-18 20:23   ` Matthew Jordan
  0 siblings, 1 reply; 5+ messages in thread
From: Thompson, David @ 2016-05-18 18:33 UTC (permalink / raw)
  To: Matthew Jordan; +Cc: Help Guix

On Wed, May 18, 2016 at 2:24 PM, Matthew Jordan
<matthewjordandevops@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about package environment variables
  2016-05-18 18:33 ` Thompson, David
@ 2016-05-18 20:23   ` Matthew Jordan
  2016-05-18 20:30     ` Thompson, David
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Jordan @ 2016-05-18 20:23 UTC (permalink / raw)
  To: Thompson, David; +Cc: Help Guix


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
> <matthewjordandevops@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about package environment variables
  2016-05-18 20:23   ` Matthew Jordan
@ 2016-05-18 20:30     ` Thompson, David
  2016-05-18 20:44       ` Matthew Jordan
  0 siblings, 1 reply; 5+ messages in thread
From: Thompson, David @ 2016-05-18 20:30 UTC (permalink / raw)
  To: Matthew Jordan; +Cc: Help Guix

On Wed, May 18, 2016 at 4:23 PM, Matthew Jordan
<matthewjordandevops@yandex.com> wrote:
>
> 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.

Why would you want this?  I don't understand.

- Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about package environment variables
  2016-05-18 20:30     ` Thompson, David
@ 2016-05-18 20:44       ` Matthew Jordan
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Jordan @ 2016-05-18 20:44 UTC (permalink / raw)
  To: Thompson, David; +Cc: Help Guix


Do you mean why I would want to define environment variables in project
guix.scm file?

If so, it would be a matter convienence I can put all the project info
in one file. Also I wouldn't have to remember any shell/environment
variables I changed or customized for a specific project.

-- 
Matthew Jordan
Sent with my mu4e

Thompson, David writes:

> On Wed, May 18, 2016 at 4:23 PM, Matthew Jordan
> <matthewjordandevops@yandex.com> wrote:
>>
>> 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.
>
> Why would you want this?  I don't understand.
>
> - Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-18 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18 18:24 Question about package environment variables Matthew Jordan
2016-05-18 18:33 ` Thompson, David
2016-05-18 20:23   ` Matthew Jordan
2016-05-18 20:30     ` Thompson, David
2016-05-18 20:44       ` Matthew Jordan

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).