all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#47344] guix-cookbook : (Basic setup with mafinests)
@ 2021-03-23 14:44 Fulbert
  2021-03-23 15:14 ` Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 1 reply; 3+ messages in thread
From: Fulbert @ 2021-03-23 14:44 UTC (permalink / raw)
  To: 47344

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

… 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

[-- Attachment #2: guix-cookbook.texi.patch --]
[-- Type: text/plain, Size: 2926 bytes --]

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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#47344] guix-cookbook : (Basic setup with mafinests)
  2021-03-23 14:44 [bug#47344] guix-cookbook : (Basic setup with mafinests) Fulbert
@ 2021-03-23 15:14 ` Tobias Geerinckx-Rice via Guix-patches via
  2021-03-23 18:20   ` Fulbert
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2021-03-23 15:14 UTC (permalink / raw)
  To: Fulbert; +Cc: 47344

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#47344] guix-cookbook : (Basic setup with mafinests)
  2021-03-23 15:14 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2021-03-23 18:20   ` Fulbert
  0 siblings, 0 replies; 3+ messages in thread
From: Fulbert @ 2021-03-23 18:20 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 47344

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-23 19:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-23 14:44 [bug#47344] guix-cookbook : (Basic setup with mafinests) Fulbert
2021-03-23 15:14 ` Tobias Geerinckx-Rice via Guix-patches via
2021-03-23 18:20   ` Fulbert

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.