From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Jordan Subject: Re: Question about package environment variables Date: Wed, 18 May 2016 16:23:31 -0400 Message-ID: <87oa83xgho.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> References: <87posjxm0i.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b380y-0005cj-UM for help-guix@gnu.org; Wed, 18 May 2016 16:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b380u-0007VO-SN for help-guix@gnu.org; Wed, 18 May 2016 16:24:20 -0400 Received: from forward15h.cmail.yandex.net ([87.250.230.157]:32949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b380t-0007TG-FD for help-guix@gnu.org; Wed, 18 May 2016 16:24:16 -0400 In-reply-to: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" 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 > 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