From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0C3VE7Q6hWHRPwAAgWs5BA (envelope-from ) for ; Fri, 05 Nov 2021 15:07:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4Pp+D7Q6hWGUMQAAB5/wlQ (envelope-from ) for ; Fri, 05 Nov 2021 14:07:48 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D4C4C13BE4 for ; Fri, 5 Nov 2021 15:07:47 +0100 (CET) Received: from localhost ([::1]:45994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mizsg-0004pk-TB for larch@yhetil.org; Fri, 05 Nov 2021 10:07:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mizp4-0006NP-RO for guix-patches@gnu.org; Fri, 05 Nov 2021 10:04:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mizp4-0006bD-JR for guix-patches@gnu.org; Fri, 05 Nov 2021 10:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mizp4-0007Nn-Fw for guix-patches@gnu.org; Fri, 05 Nov 2021 10:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51543] [PATCH 2/2] doc: Improve documentation of the Bash home service Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 05 Nov 2021 14:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51543 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51543@debbugs.gnu.org Cc: Liliana Marie Prikler Received: via spool by 51543-submit@debbugs.gnu.org id=B51543.163612101928336 (code B ref 51543); Fri, 05 Nov 2021 14:04:02 +0000 Received: (at 51543) by debbugs.gnu.org; 5 Nov 2021 14:03:39 +0000 Received: from localhost ([127.0.0.1]:46716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mizoh-0007Mx-Bj for submit@debbugs.gnu.org; Fri, 05 Nov 2021 10:03:39 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33924 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mizog-0007Mj-BY for 51543@debbugs.gnu.org; Fri, 05 Nov 2021 10:03:38 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1636121012; bh=gkfAFg7N1avHfumXzUmptlBSP1zEaobAGMkOLMgwhIU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=K1ppp8gKD8klGE6sEAvV81aNM1k9uLmxlEVpDDWfw6AE8qIBj1T2CVueK6Pxyb2zj o4Cigyzj1vmlwYtauFCyoVIO5wkvsqq3XFyvI5FRhera0Dw6AbyKJYP1ER1O4AQifN Pvkk+WWfCuw09nOAGa0SjAh23BxU1GUNU3UYrWas= In-Reply-To: References: Message-Id: Date: Fri, 05 Nov 2021 15:03:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636121268; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MzAvB7tQE0gf6QaqWWeY2owQrHE+w+ZVzGwJvFIQiGM=; b=Day6alZnQ9Vou9z5vD0mH4Dkjq+fYCU9KWdgja2EkKnN+J0wC//qfHFuXe+y5jrHWv/sSm 39ErTc/XSt5ig8HKA28iTYes1tWkxR2yyspnw7SfQZRKOmIACF0uZzoO53yYp1EaNVHmgv ODtJbhOo/4J4F2v6bNzN/4WIBp55nPgxSk7ZpxrTJtzK3gJfcVE1SwJe2XfKoH9GjEjPpr kpxEE4DqcoUzFCJjWtFQfDL+9J0tRC+GeXQtSjTR6FvxT7HFNen0T+2QtSD+hOlqmRMmI5 MfRoLYqiMuGXo6FgAvQhfly3r6ditMqLWve2VOh09FKXCh1nqc1rhIygLvkg8Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636121268; a=rsa-sha256; cv=none; b=XhZzjom1ryUOOImgXjH51uWMckz49A1CEuPBFh7TQrPa8LqZjXgAEu9FWCWETO0uCI8YFK PmpHRCbWHrDEMV+o5ybHtEspfsmy9VZbSM07H4ZD038GauRkgKrRQkOWqKc867xnXp/ZDk bLy4qw50JRhFa3LoSE1AaGuQGnu27FH8j/KdZbcqHuMQeBqa5YKa8J7qmCTFr6jc0vDoko 4RMt7UGt9zzBX5iUSi4UwlbiaW2VmdVT7Jd57ERO8Z23VPlG2K/ZjE2u7g3xgmfz3CIWPx 3WNEc3Bz7TsqmIOItJnTOSQ/8y2IDS8jx6zr0U1AEMai3F35TmYOYOnvmwyEHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=K1ppp8gK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=K1ppp8gK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: D4C4C13BE4 X-Spam-Score: -0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: vjUIOOvNJj70 * doc/guix.texi (Shells Home Services): Document =E2=80=98home-bash-extensi= on=E2=80=99 configuration record. * gnu/home/services/shells.scm (generate-home-bash-documentation): Extract docstrings from =E2=80=98home-bash-extension=E2=80=99. (home-bash-configuration): Expound on docstrings. Fixes: --- doc/guix.texi | 44 ++++++++++++++++++++++++++++++++---- gnu/home/services/shells.scm | 29 ++++++++++++++++-------- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f7312a5b30..002193e994 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36159,6 +36159,7 @@ =20 @subsubheading Bash Home Service =20 +@anchor{home-bash-configuration} @deftp {Data Type} home-bash-configuration Available @code{home-bash-configuration} fields are: =20 @@ -36167,15 +36168,20 @@ The Bash package to use. =20 @item @code{guix-defaults?} (default: @code{#t}) (type: boolean) -Add sane defaults like reading @file{/etc/bashrc}, coloring output for -@code{ls} provided by guix to @file{.bashrc}. +Add sane defaults like reading @file{/etc/bashrc} and coloring the output = of +@command{ls} to the end of the @file{.bashrc} file. =20 @item @code{environment-variables} (default: @code{()}) (type: alist) -Association list of environment variables to set for the Bash session. +Association list of environment variables to set for the Bash session. The +rules for the @code{home-environment-variables-service-type} apply +here (@pxref{Essential Home Services}). The contents of this field will be +added after the contents of the @code{bash-profile} field. =20 @item @code{aliases} (default: @code{()}) (type: alist) -Association list of aliases to set for the Bash session. The alias will -automatically be quoted, so something line this: +Association list of aliases to set for the Bash session. The aliases +will be defined after the contents of the @code{bashrc} field has been +put in the @file{.bashrc} file. The alias will automatically be quoted, +so something line this: =20 @lisp '((\"ls\" . \"ls -alF\")) @@ -36206,7 +36212,35 @@ process for example). =20 @end table +@end deftp + +You can extend the Bash service by using the @code{home-bash-extension} +configuration record, whose fields most mirror that of +@code{home-bash-configuration} (@pxref{home-bash-configuration}). The +contents of the extensions will be added to the end of the corresponding +Bash configuration files (@pxref{Bash Startup Files,,, bash, The GNU +Bash Reference Manual}. + +@deftp {Data Type} home-bash-extension +Available @code{home-bash-extension} fields are: + +@table @asis +@item @code{environment-variables} (default: @code{()}) (type: alist) +Association list of environment variables to set. + +@item @code{aliases} (default: @code{()}) (type: alist) +Association list of aliases to set. =20 +@item @code{bash-profile} (default: @code{()}) (type: text-config) +List of file-like objects. + +@item @code{bashrc} (default: @code{()}) (type: text-config) +List of file-like objects. + +@item @code{bash-logout} (default: @code{()}) (type: text-config) +List of file-like objects. + +@end table @end deftp =20 @subsubheading Zsh Home Service diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index f24e47f762..9b8427da7b 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -323,16 +323,21 @@ (define-configuration home-bash-configuration "The Bash package to use.") (guix-defaults? (boolean #t) - "Add sane defaults like reading @file{/etc/bashrc}, coloring output -for @code{ls} provided by guix to @file{.bashrc}.") + "Add sane defaults like reading @file{/etc/bashrc} and coloring the out= put of +@command{ls} to the end of the @file{.bashrc} file.") (environment-variables (alist '()) - "Association list of environment variables to set for the Bash session." + "Association list of environment variables to set for the Bash session.= The +rules for the @code{home-environment-variables-service-type} apply +here (@pxref{Essential Home Services}). The contents of this field will be +added after the contents of the @code{bash-profile} field." serialize-posix-env-vars) (aliases (alist '()) - "Association list of aliases to set for the Bash session. The alias wi= ll -automatically be quoted, so something line this: + "Association list of aliases to set for the Bash session. The aliases = will be +defined after the contents of the @code{bashrc} field has been put in the +@file{.bashrc} file. The alias will automatically be quoted, so something= line +this: =20 @lisp '((\"ls\" . \"ls -alF\")) @@ -646,10 +651,16 @@ (define (generate-home-shell-profile-documentation) 'home-shell-profile-configuration)) =20 (define (generate-home-bash-documentation) - (generate-documentation - `((home-bash-configuration - ,home-bash-configuration-fields)) - 'home-bash-configuration)) + (string-append + (generate-documentation + `((home-bash-configuration + ,home-bash-configuration-fields)) + 'home-bash-configuration) + "\n\n" + (generate-documentation + `((home-bash-extension + ,home-bash-extension-fields)) + 'home-bash-extension))) =20 (define (generate-home-zsh-documentation) (generate-documentation --=20 2.33.0