From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roel Janssen Subject: Adding a subcommand "load-profile" Date: Tue, 28 Apr 2020 17:42:53 +0200 Message-ID: <490f77b9f9b0829f985ba717f6fbe008f54a816d.camel@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54466) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTSNv-00030r-9j for guix-devel@gnu.org; Tue, 28 Apr 2020 11:43:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33734) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTSNv-0005eJ-06 for guix-devel@gnu.org; Tue, 28 Apr 2020 11:42:59 -0400 Received: from 2001-1c02-0b03-a700-f532-4553-7f2a-9b68.cable.dynamic.v6.ziggo.nl ([2001:1c02:b03:a700:f532:4553:7f2a:9b68]:49602) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jTSNt-0001zL-90 for guix-devel@gnu.org; Tue, 28 Apr 2020 11:42:58 -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-mx.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Dear Guix, Years ago we implemented GNU Guix on the high-performance computing cluster in Utrecht. One of the things we added was a wrapper around the "guix" command (called "guixr") to enable communication between the guix-daemon (on one node), and the client-side "guix" command. (We actually copied the great "guixr" script from Ricardo at the time.) Lots of improvements have been made for the HPC use-case that the need for the "guixr" wrapper script is no longer needed. Except for one thing. We added a subcommand in the "guixr" script called "load-profile". It allows a user to do the following: -------------------------------------------------------------------------------- $ guixr package -i ... -p /my/profile $ guixr load-profile /my/profile [env]$ # ... A new shell is spawned here. # Inside this shell only the environment variables in # /my/profile/etc/profile are set ... [env]$ exit # Return to the normal shell state -------------------------------------------------------------------------------- The code of "guixr" is available at [1]. I sometimes wish I had this command available in "guix" itself. So I'd like to implement the "load-profile" subcommand in Scheme, so that it can be part of Guix. Would there be any interest from others to have this as well? And also, the shell implementation heavy relies on Bash. What other shells should I attempt to implement? If there is interest in having this as a "load-profile" subcommand, I will post an initial implementation to the mailing list ASAP. Thanks all! Kind regards, Roel Janssen [1] https://github.com/UMCUGenetics/guix-additions/blob/master/umcu/packages/guix.scm#L191-L339