unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Charles <charles.b.jackson@protonmail.com>, 54375@debbugs.gnu.org
Subject: [bug#54375] Mutable guix shell environments
Date: Sun, 13 Mar 2022 20:51:43 +0100	[thread overview]
Message-ID: <68a3e146199e408d50e4ed751e1b7000364704f5.camel@gmail.com> (raw)
In-Reply-To: <Zycszoymk_U1ui1Ek6NODmj1rphro1ZjtzltZf6rnv7wtFAxmj0DW8IRWerZaW3PkR80EmJ6Fru8R7pp9dzDpPoh-FFzqeGAsB_Ivs4Ipr4=@protonmail.com>

Am Sonntag, dem 13.03.2022 um 18:21 +0000 schrieb Charles:

> Subject: [PATCH 2/2] guix: shell: Implicitly use a .guix-profile as -
> -profile option.
> 
> * guix/scripts/shell.scm (auto-detect-manifest): Add ".guix-profile"
> to matches as --profile option
This one LGTM and it even avoids some problems we're having with
caches.  I'll keep it open for bikeshedding suggestions w.r.t. the name
of the directory to detect, though.

> Subject: [PATCH 1/2] guix: environment: Enable mutable environments.
> 
> * guix/scripts/environment.scm (launch-environment launch-
> environment/fork
> launch-environment/container guix-environment*): Add #:set-profile?
> parameter set GUIX_PROFILE
> when --profile option is used.
> * guix/scripts/environment.scm (guix-environment*): Profile could
> point to a
> profile directory instead of a store directory.
This one not so much.  You already have GUIX_ENVIRONMENT set, which
should be enough for lookup purposes.  If it's about manipulating PATH
and other environment variables, I think it'd better to do this
manually – you could even spawn a lightweight shell on your own by
simply doing the following:

$ $SHELL
$ GUIX_PROFILE=/path/to/profile
$ source $GUIX_PROFILE/etc/profile

If you want mutable environments, that's the easiest and imho best way
of achieving such a thing.  Guix is functional by design and we should
not compromise on that.

As far as using $GUIX_PROFILE together with `guix shell' is concerned,
if anything is even holding it back, it's that we don't respect
GUIX_PROFILE in the Scheme code that adds those variables.  Which to be
fair might be for the best, as GUIX_PROFILE is not guaranteed to
correspond to this invocation of `guix shell' when people are careless.
That's not to say that support for this couldn't be added, but at the
very least we'd have to be more careful about it.

Cheers




  reply	other threads:[~2022-03-13 19:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 18:21 [bug#54375] Mutable guix shell environments Charles via Guix-patches via
2022-03-13 19:51 ` Liliana Marie Prikler [this message]
2022-03-13 23:38   ` Charles via Guix-patches via
2022-03-14  5:19     ` Liliana Marie Prikler
2022-03-14  6:24       ` Charles via Guix-patches via
2022-03-14 17:43 ` Maxime Devos
2022-03-14 17:54 ` Maxime Devos
2022-03-14 19:41   ` Charles via Guix-patches via
2022-03-14 22:18   ` Ludovic Courtès
2022-03-15  9:49     ` zimoun
2022-03-15 23:52       ` Charles via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68a3e146199e408d50e4ed751e1b7000364704f5.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=54375@debbugs.gnu.org \
    --cc=charles.b.jackson@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).