From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: The future of 'guix environment' Date: Thu, 31 Aug 2017 09:28:28 -0400 Message-ID: References: <87efrsyzl4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnPWJ-0000EA-7O for guix-devel@gnu.org; Thu, 31 Aug 2017 09:28:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnPWI-0005ab-4G for guix-devel@gnu.org; Thu, 31 Aug 2017 09:28:31 -0400 Received: from mail-ua0-x236.google.com ([2607:f8b0:400c:c08::236]:35558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dnPWH-0005aS-Vj for guix-devel@gnu.org; Thu, 31 Aug 2017 09:28:30 -0400 Received: by mail-ua0-x236.google.com with SMTP id c27so1792818uah.2 for ; Thu, 31 Aug 2017 06:28:29 -0700 (PDT) In-Reply-To: <87efrsyzl4.fsf@gnu.org> 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: Jan Nieuwenhuizen Cc: guix-devel On Thu, Aug 31, 2017 at 3:18 AM, Jan Nieuwenhuizen wrote: > Thompson, David writes: > >> Hi all, been awhile! > > Hi David! > > Great suggestions all! I use guix environment heavily and like it a > lot. Thanks! >> 4) Make 'guix environment' with no other args operate like 'guix >> environment --cache --load=guix.scm'. 'guix.scm' is a placeholder >> name for whatever we decide the conventional name for an environment >> config should be. > > Wouldn't that be > > guix environment --cache --dependencies --load=guix.scm No, because guix.scm would no longer evaluate to a package object, but an environment object. Flags like --dependencies are for environments defined on the fly at the command line. I haven't yet decided if --load should be mutually exclusive from all those other things, but I think that should probably be the case. Perhaps introducing subcommands is the best thing UX-wise. 'guix environment load guix.scm', 'guix environment shell direnv --dependencies ruby', and 'guix environment' would be a shorthand for 'guix environment load'. This will take some fiddling to see. I'm going to get the core features implemented first, then work on the UX. > I have been using an ugly hack to switch profiles (or environments; look > at $GUIX_ENVIRONMENT) in Emacs, see attached. As discussed briefly on > irc yesterday are various ways this could go: use emacs-direnv, read the > manifest file in elisp, use guix repl to read it..etc I took a look at emacs-direnv and did not like it because it's not fully implemented in elisp. You also need the direnv tool itself, which is written in Go. No thanks! I think the integration should happen with emacs-guix, which could use the Guile REPL to read the profile manifest, and send an sexp back to Emacs with key/value pairs for the values of all environment variables. From there it's easy to use setenv and tweak exec-path in the case of $PATH. Alex Kost would know a lot better than I about how to get this done. - Dave