From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: How can I replace Python venv and pip with Guix? Date: Tue, 04 Feb 2020 15:02:36 +0100 Message-ID: <87y2tiqwlf.fsf@elephly.net> References: <170082257a9.bbf196a73697.871070894081541659@zoho.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60471) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyymv-0006bW-6n for help-guix@gnu.org; Tue, 04 Feb 2020 09:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyymu-0004kx-1U for help-guix@gnu.org; Tue, 04 Feb 2020 09:02:49 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyymt-0004iF-O8 for help-guix@gnu.org; Tue, 04 Feb 2020 09:02:47 -0500 In-reply-to: <170082257a9.bbf196a73697.871070894081541659@zoho.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: sirgazil Cc: help-guix@gnu.org sirgazil writes: > =E2=80=A2 Once I deactivate this environment (Ctrl+D), how can I activate= it again? It=E2=80=99s a matter of evaluating the etc/profile file that is generated = for every Guix profile. Since you passed --root=3D/path/to/my-guix-envs/my-project to =E2=80=9Cguix environment=E2=80=9D there will be a file /path/to/my-guix-envs/my-project/etc/profile You can set all the environment variables it defines with GUIX_PROFILE=3D/path/to/my-guix-envs/my-project source $GUIX_PROFILE/etc/profile If you want a pure environment you can use =E2=80=9Cenv=E2=80=9D. On our H= PC cluster I provide =E2=80=9Cactivate=E2=80=9D scripts like this one: --8<---------------cut here---------------start------------->8--- #!/bin/bash profile=3D/path/to/.guix-profile prompt=3D'\u@\h:\W \[\e[31;47;1m\][pigx]\[\e[m\] $ ' REAL_HOME=3D$HOME exec /bin/env - PS1=3D"$prompt" \ HOME=3D$REAL_HOME \ LANG=3Den_US.UTF-8 \ GUIX_LOCPATH=3D"$profile/lib/locale" \ CURL_CA_BUNDLE=3D"/etc/ssl/certs/ca-bundle.crt" \ /bin/bash --init-file "$profile/etc/profile" --8<---------------cut here---------------end--------------->8--- It sets a few environment variables, recovers some variables that are important, and then starts a sub-shell that uses the generated etc/profile file as its init file. Something like that might work for you. -- Ricardo