From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: The future of 'guix environment' Date: Thu, 31 Aug 2017 09:18:47 +0200 Message-ID: <87efrsyzl4.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnJkp-0001xT-Er for guix-devel@gnu.org; Thu, 31 Aug 2017 03:19:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnJkl-000422-Ea for guix-devel@gnu.org; Thu, 31 Aug 2017 03:19:07 -0400 In-Reply-To: (David Thompson's message of "Wed, 30 Aug 2017 09:22:13 -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" To: "Thompson, David" Cc: guix-devel --=-=-= Content-Type: text/plain Thompson, David writes: > Hi all, been awhile! Hi David! Great suggestions all! I use guix environment heavily and like it a lot. > 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 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 Greetings, janneke --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=guix-environment.el Content-Transfer-Encoding: quoted-printable (defun matches-in-string (regexp string) "return a list of matches of REGEXP in STRING." (let ((matches)) (save-match-data (string-match "^" "") (while (string-match regexp string (match-end 0)) (push (or (match-string 1 string) (match-string 0 string)) matches)= )) matches)) (defun guix-switch-profile (&optional profile) "reset Emacs' environment by snarfing PROFILE/etc/profile" (interactive "fprofile: ") (let* ((output (shell-command-to-string (concat "/bin/sh -x " profile "/e= tc/profile"))) (exports (matches-in-string "^[+] export \\(.*\\)" output))) (mapcar (lambda (line) (apply #'setenv (split-string line "=3D"))) expor= ts ))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=--