From patchwork Tue Mar 23 14:44:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fulbert X-Patchwork-Id: 28028 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9406827BC59; Tue, 23 Mar 2021 14:53:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B4EBB27BC5C for ; Tue, 23 Mar 2021 14:53:52 +0000 (GMT) Received: from localhost ([::1]:36182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOiPn-0002DL-QV for patchwork@mira.cbaines.net; Tue, 23 Mar 2021 10:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOiIE-0002LW-2K for guix-patches@gnu.org; Tue, 23 Mar 2021 10:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOiID-0008A4-Of for guix-patches@gnu.org; Tue, 23 Mar 2021 10:46:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lOiID-00072p-NX for guix-patches@gnu.org; Tue, 23 Mar 2021 10:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47344] guix-cookbook : (Basic setup with mafinests) Resent-From: Fulbert Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Mar 2021 14:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 47344@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161651070827008 (code B ref -1); Tue, 23 Mar 2021 14:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Mar 2021 14:45:08 +0000 Received: from localhost ([127.0.0.1]:60936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOiHL-00071Y-La for submit@debbugs.gnu.org; Tue, 23 Mar 2021 10:45:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:48852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOiHJ-00071N-2d for submit@debbugs.gnu.org; Tue, 23 Mar 2021 10:45:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOiHI-0001Lu-Oo for guix-patches@gnu.org; Tue, 23 Mar 2021 10:45:04 -0400 Received: from vimdzmsp-sfwd02.bluewin.ch ([195.186.227.131]:55339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOiHG-0007Uk-I2 for guix-patches@gnu.org; Tue, 23 Mar 2021 10:45:04 -0400 Received: from bluewin.ch ([85.5.44.62]) by vimdzmsp-sfwd02.bluewin.ch Swisscom AG with ESMTPA id OiHDlSxLCIn7COiHElzmVb; Tue, 23 Mar 2021 15:45:00 +0100 X-Bluewin-Spam-Analysis: v=2.4 cv=daFFYVbe c=1 sm=1 tr=0 ts=6059feec a=bLoAJnPGBKLbGpzEBMhwHQ==:117 a=RhqaMz7EtA_yR4BBwmQA:9 a=QEXdDO2ut3YA:10 a=Q_hwkIaQF7DZ1ZajMcoA:9 a=JOWeiY5itpwPQvuQ8dm/GawRuwE=:19 X-Bluewin-Spam-Score: 0.00 X-FXIT-IP: IPv4[85.5.44.62] Epoch[1616510700] X-Bluewin-AuthAs: fulbert@bluewin.ch Date: Tue, 23 Mar 2021 15:44:59 +0100 From: Fulbert Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CMAE-Envelope: MS4xfKfe/2kVOBvHeMOU4JPSDp5ffsEPoY4rF7rCvoaL650EIawhKDiRiJB7B6FCXbigXHLibginGbJmD2ewKDBrwaDwQS+NTccRiG6YOshyvHmafq97enrg vyZNFg2RL4/1hFuvmb8UsrBEd0UR8YrmXFF2z8i9hpyed+Xw2o8BuvprFQ8JnPxDibY8x5F9ti3rYg== Received-SPF: pass client-ip=195.186.227.131; envelope-from=fulbert@bluewin.ch; helo=vimdzmsp-sfwd02.bluewin.ch X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches … 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 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: