unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Charles via Guix-patches via <guix-patches@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 54375@debbugs.gnu.org
Subject: [bug#54375] Mutable guix shell environments
Date: Sun, 13 Mar 2022 23:38:19 +0000	[thread overview]
Message-ID: <9QXS8i-Ylzc9pxojB3WT0LMPFqm00N-jwx08sZnPLn7KmSvC85K7jvgGmQTcg138EEa6Aqh7W4n87KXkZvxJyt--ze0rCVnGVG2SMskLgNU=@protonmail.com> (raw)
In-Reply-To: <68a3e146199e408d50e4ed751e1b7000364704f5.camel@gmail.com>

Thanks for taking a look Liliana. I'm glad you like guix shell detecting a local profile.

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

This is basically what I was going for. I just find this useful to be built in. When I think "guix shell", I think: "make an environment where I have everything I need". If I want to adjust what I need, why do I need to restart everything from scratch. If I did not know about guix shell and did all my development using ~/.guix-profile, this functionallity would already be available.

> Guix is functional by design and we should
not compromise on that.

I totally agree, and I do not think this does compromise it. With my patch, guix shells using guix.scm or manifest, would be unchanged. Currently, guix shell --profile, has strickly less functionallity than using the profile otherwise, this could be confusing (as it is to me). Profiles are not really mutable since they use generations; the subject line is a bit of a misnomer.

> As far as using $GUIX_PROFILE tog...

Yeah, before my patch, guix shell --profile, would not be set to the profile I'm using. This actually makes sense, because, we are not really using it. Guix shell just happens to be using all the same packages that were available in that profile. Confusingly, If the profile, is updated, the shell is now out of sync with it. My patch should make using guix shell --profile more intuitive.


------- Original Message -------

On Sunday, March 13th, 2022 at 2:51 PM, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

> 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 23:40 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
2022-03-13 23:38   ` Charles via Guix-patches via [this message]
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='9QXS8i-Ylzc9pxojB3WT0LMPFqm00N-jwx08sZnPLn7KmSvC85K7jvgGmQTcg138EEa6Aqh7W4n87KXkZvxJyt--ze0rCVnGVG2SMskLgNU=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=54375@debbugs.gnu.org \
    --cc=charles.b.jackson@protonmail.com \
    --cc=liliana.prikler@gmail.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).