diff mbox series

[bug#47344] guix-cookbook : (Basic setup with mafinests)

Message ID YFn+6820/lIMD2+I@bluewin.ch
State New
Headers show
Series [bug#47344] guix-cookbook : (Basic setup with mafinests) | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Fulbert March 23, 2021, 2:44 p.m. UTC
… 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(-)

Comments

Tobias Geerinckx-Rice March 23, 2021, 3:14 p.m. UTC | #1
Hi Fulbert,

Fulbert 写道:
> … 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

[0]: http://issues.guix.gnu.org/47343
[1]: http://issues.guix.gnu.org/47344
Fulbert March 23, 2021, 6:20 p.m. UTC | #2
Le Tue, Mar 23, 2021 at 04:14:07PM +0100, Tobias Geerinckx-Rice a écrit :
> Hi Fulbert,

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

Best regards,
Fulbert
diff mbox series

Patch

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: