From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: Re: [PATCH] gnu: Add direnv Date: Wed, 14 Sep 2016 15:49:21 +0800 Message-ID: <87intyrke6.fsf@member.fsf.org> References: <20160910163933.24468-1-mail@cbaines.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk4wt-0007Gj-5e for guix-devel@gnu.org; Wed, 14 Sep 2016 03:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bk4wp-0001k6-T5 for guix-devel@gnu.org; Wed, 14 Sep 2016 03:49:39 -0400 Received: from smtp4.openmailbox.org ([62.4.1.38]:33173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk4wp-0001j1-NU for guix-devel@gnu.org; Wed, 14 Sep 2016 03:49:35 -0400 In-Reply-To: <20160910163933.24468-1-mail@cbaines.net> (Christopher Baines's message of "Sat, 10 Sep 2016 17:39:32 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Christopher Baines Cc: guix-devel@gnu.org Christopher Baines writes: > direnv is an environment switcher for the shell. direnv can be used with many > tools, including Guix environments. > > I was lucky enough to meet the original author in London, who showed me direnv, > and helped me write a function for my .direnvrc file to make it easy to use > with Guix. > > I have the following in my .direnvrc file (in my home directory). > > use_guix() { > eval "$(guix environment "$@" --search-paths)" > } > > This means that I can have something like the following in my .envrc files > > use_guix --ad-hoc guile > > You need to add a shell hook, and "allow" this file, but after that is done, > just changing in and out of the directory with the .envrc file in it will > adjust the environmental variables in your shell. Cool, applied, thanks!