From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: guix-shell? Date: Thu, 28 Aug 2014 17:50:12 +0200 Message-ID: <87vbpc8vgr.fsf@gnu.org> References: <87fvgo3mlx.fsf@gnu.org> <87zjesgqc5.fsf_-_@gnu.org> <878umb30sx.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN1xr-0006kG-Tu for guix-devel@gnu.org; Thu, 28 Aug 2014 11:50:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XN1xl-0000ak-V6 for guix-devel@gnu.org; Thu, 28 Aug 2014 11:50:19 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:49436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN1xl-0000aZ-Ok for guix-devel@gnu.org; Thu, 28 Aug 2014 11:50:13 -0400 In-Reply-To: <878umb30sx.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Tue, 26 Aug 2014 08:14:38 -0400") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel David Thompson skribis: > Okay, so after digging into nix's source code a bit, I've learned a few > things. nix-shell is really just a symlink to nix-build, and it doesn't > seem to use profiles at all! When nix-build is called as 'nix-shell', > it's behavior changes. From the manual: "The command nix-shell will > build the dependencies of the specified derivation, but not the > derivation itself." Ooh, OK. Interesting. > I can see that the nix-build script exits before adding the derivation > to the store when called as 'nix-shell'. > > Here's the relevant Perl source code: [...] > (Thank you for choosing Scheme, btw) Yup. :-) > I found it confusing to have the build script also handle the shell via > some conditional logic. I think Guix could do it better. +1 > I will implement 'guix shell' if I can get your opinion on the best > approach to take. Would you tweak guix/scripts/build.scm to handle > the special case or export the necessary procedures and create a > guix/scripts/shell.scm module? The problem with a command that spawns a shell IMO is that it does not compose well: you get a new shell (which shell program is actually run?), and you can influence a running shell, or use it in a script, etc. So instead I would imagine a command like: guix environment emacs which would build the dependencies of Emacs, and then output the search path as per =E2=80=98guix package --search-paths=E2=80=99, so that one can = just source it and be done. In addition, one could do things like: guix environment -l foo.scm Things like that. WDYT? Thanks, Ludo=E2=80=99.