guix-cookbook : (Basic setup with mafinests)

  • Open
  • quality assurance status badge
Details
2 participants
  • Fulbert
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Fulbert
Severity
normal
Merged with
F
F
Fulbert wrote on 23 Mar 2021 15:44
(address . guix-patches@gnu.org)
YFn+6820/lIMD2+I@bluewin.ch
… with the patch this time !

Hello,

I propose those changes to (Basic setup with mafinests) as they
are more likely to produce the exptected result. Probably the
`combined` search-paths profiles were not available at the time of
writing this section ?!

Although It works well for me, I'm not 100% sure it should make it
to live guix-cookbook. Not sure either if filtering-out
$HOME/.config/guix/current is necessary.

Anyway, I thought it was worth proposing :)

Best regards,
Fulbert
From 352b4bbbec7acd51d01a05f11b0e59bbe8b2b2cb Mon Sep 17 00:00:00 2001
From: Fulbert <fulbert@bluewin.ch>
Date: Tue, 23 Mar 2021 14:26:15 +0100
Subject: [PATCH] =?UTF-8?q?doc:=20cookbook:=20modify=20=E2=80=9Cenable=20a?=
=?UTF-8?q?ll=20profiles=20on=20login=E2=80=9D=20examples.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/guix-cookbook.texi (Basic setup with mafinests): “enable all
profiles on login” examples changed from etc/profile sourcing to
combined profiles eval's.
---
doc/guix-cookbook.texi | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)

Toggle diff (64 lines)
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 1cddaa7faf..81339f16b3 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -2531,14 +2531,13 @@ although you'll probably have to filter out @file{~/.config/guix/current}.
To enable all profiles on login, add this to your @file{~/.bash_profile} (or similar):
@example
-for i in $GUIX_EXTRA_PROFILES/*; do
- profile=$i/$(basename "$i")
- if [ -f "$profile"/etc/profile ]; then
- GUIX_PROFILE="$profile"
- . "$GUIX_PROFILE"/etc/profile
- fi
- unset profile
-done
+search_paths_profiles() @{
+ for p in $(guix package --list-profiles); do
+ [[ "$p" != "$HOME/.config/guix/current" ]] \
+ && echo -n "-p $p "
+ done
+@}
+eval $(guix package $(search_paths_profiles) --search-paths=suffix)
@end example
Note to Guix System users: the above reflects how your default profile
@@ -2548,14 +2547,13 @@ Note to Guix System users: the above reflects how your default profile
You can obviously choose to only enable a subset of them:
@example
-for i in "$GUIX_EXTRA_PROFILES"/my-project-1 "$GUIX_EXTRA_PROFILES"/my-project-2; do
- profile=$i/$(basename "$i")
- if [ -f "$profile"/etc/profile ]; then
- GUIX_PROFILE="$profile"
- . "$GUIX_PROFILE"/etc/profile
- fi
- unset profile
-done
+search_paths_profiles() @{
+ for p in $(guix package --list-profiles); do
+ [[ "$p" =~ (my-project-1)|(my-project-2)|(…) ]] \
+ && echo -n "-p $p "
+ done
+@}
+eval $(guix package $(search_paths_profiles) --search-paths=suffix)
@end example
When a profile is off, it's straightforward to enable it for an individual shell
@@ -2575,8 +2573,11 @@ It contains the same variables you would get if you ran:
guix package --search-paths=prefix --profile=$my_profile"
@end example
-Once again, see (@pxref{Invoking guix package,,, guix, GNU Guix Reference Manual})
-for the command line options.
+Note that you can also use this option to compute
+@emph{combined --search-paths} of several profiles, as illustrated in the
+previous @samp{~/.bash_profile} example.
+
+Once again, see (@pxref{Invoking guix package,,, guix, GNU Guix Reference Manual}) for the command line options.
To upgrade a profile, simply install the manifest again:
--
2.31.0
T
T
Tobias Geerinckx-Rice wrote on 23 Mar 2021 16:06
(no subject)
(address . control@debbugs.gnu.org)
87y2ed7vuv.fsf@nckx
merge 47344 47343
T
T
Tobias Geerinckx-Rice wrote on 23 Mar 2021 16:14
Re: [bug#47344] guix-cookbook : (Basic setup with mafinests)
(name . Fulbert)(address . fulbert@bluewin.ch)
87v99h7vi8.fsf@nckx
Hi Fulbert,

Fulbert ???
Toggle quote (2 lines)
> … with the patch this time !

Thanks!

Every time you send a new mail to bug-guix@gnu.org it will create
a new bug number. In this case you accidentally created two bug
reports, [0] and [1].

No big deal, and I've merged them into one now, but make sure to
send replies to an existing thread to the correct
nnnnn@debbugs.gnu.org address. If you CC bug-guix@ in addition to
that, as some mail clients do by default, Debbugs will still know
what you mean.

...and since you seem to be interested in submitting patches
(yay!):

This also applies to multi-patch series: if you send 5 patches to
bug-guix@ or guix-patches@, 5 separate issues will be created. In
that case, send a single cover letter to bug-guix/guix-patches@,
wait for Debbugs to respond with the bug number, then send the
actual patches to nnnnn@debbugs.gnu.org.

Kind regards,

T G-R

-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYFoFvw0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15ZusA/05rraEnEyWBpwKWylYEIc3b10jQQUaVx9poCaiK
dUeuAP9cu4+Xj4S/ySs9QqAKFM6DZUDM8rH4ZarxvI0aHxs0Cw==
=AG7S
-----END PGP SIGNATURE-----

F
F
Fulbert wrote on 23 Mar 2021 19:20
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 47344@debbugs.gnu.org)
YFoxWwF4/ULhUO0/@bluewin.ch
Le Tue, Mar 23, 2021 at 04:14:07PM +0100, Tobias Geerinckx-Rice a écrit :
Toggle quote (2 lines)
> Hi Fulbert,

Hello Tobias, and yes… sorry for the nooby mess :) as well as my thanks
for the detailed instructions.

Best regards,
Fulbert
?