From patchwork Mon May 19 00:29:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42740 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 D12BE27BC4B; Mon, 19 May 2025 01:31:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 44B1927BC49 for ; Mon, 19 May 2025 01:31:23 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGoPW-0003vz-8a; Sun, 18 May 2025 20:31:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uGoPK-0003ru-5f for guix-patches@gnu.org; Sun, 18 May 2025 20:31:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGoPJ-0001Eh-Fz; Sun, 18 May 2025 20:31:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=0IgiGBMTiVorKTeGK5mSv3t2lOjylq+Qjos4cyY2yPY=; b=jlq8aCs5QXFjQeM/ihQDHRhoripgYeB8pjGoEKx97gGLvelqp2+vk+s0tRQF2Kz07+jHARDzrL8PEdsZiyQq7ZnGdIaDQ5HNZQRVvgsZitjiPxO/q70SVZyztTQvKo61JQsgtarMXd3OVDhEvcc+r5wVD91R6ocprvLouJhbr5xylPhno1Vjo72XxrEuYKiZy0qMCWKH7vvyLn5qGaJQ19gROwbsJmsCLhavqKvryxzMhvovPXaLclkyO6rcF9keVI1bt/4dMVvQcepDEC2ntTpzf6YkiFQccRT/yAMNv97fV4l6W1G7aHSnRvbQ5hpILkCD9qtnv6An0wtVU6IAMg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uGoPH-0000AH-S0; Sun, 18 May 2025 20:31:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH v3 06/10] system: Migrate sourcing bash_completion.sh to etc-bashrc-d-service-type. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: maxim.cournoyer@gmail.com, rutherther@ditigal.xyz, lgcoelho@disroot.org, gabriel@erlikon.ch, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 19 May 2025 00:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78308 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78308@debbugs.gnu.org Cc: Maxim Cournoyer , Maxim Cournoyer , Rutherther , Luis Guilherme Coelho , Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Maxim Cournoyer , Rutherther , Luis Guilherme Coelho , Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.174761461227005 (code B ref 78308); Mon, 19 May 2025 00:31:03 +0000 Received: (at 78308) by debbugs.gnu.org; 19 May 2025 00:30:12 +0000 Received: from localhost ([127.0.0.1]:34061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGoOR-0006zx-ER for submit@debbugs.gnu.org; Sun, 18 May 2025 20:30:12 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:61528) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uGoO8-0006hU-Bg for 78308@debbugs.gnu.org; Sun, 18 May 2025 20:29:57 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7424ccbef4eso3818202b3a.2 for <78308@debbugs.gnu.org>; Sun, 18 May 2025 17:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747614585; x=1748219385; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0IgiGBMTiVorKTeGK5mSv3t2lOjylq+Qjos4cyY2yPY=; b=Jpmc7XCfzje/Z9/npvZGr4XoO42nW7HPlLNZ/duh+66VVJ2H6HPtt9AB3MmQU3yzBc ZW43wUnO9VblYjcLxVPT9PBrclFurfefJKzzR77tIqS9ewUq3Nsw5h+qP7/U2DrtmUoE MFqNKaOb09BQuHq10F0akr0YwTOgXOdeS5pa1oIPznaEV828XeGUP1JdHW5oBRrDuUha Y81rRGNtRIn82bFODFMwwses344Qp/oFUyGhdvvbXfHxkkjEMgKLJOb62nPcG+XT/PEw 4nJUd2PW0Q23gldY1yMNImdd6FonC3X2pAKQOwp1mFb+Bjt28lmizcuMCfwK/nVDu9hw eHzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747614585; x=1748219385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0IgiGBMTiVorKTeGK5mSv3t2lOjylq+Qjos4cyY2yPY=; b=o58WfeyRItTOzCbrUHzeevC1K8sBX2iJElkJEVPgiLRWJoroET8yvJQjvCSr3ykeoZ NGFTxBjg4at0zabbkSKIG28tX6MzBnhJwGsPgLp6EI2EbtasLOPpUK35IafSuoNmAgTg XOMaMLhPOqemZlwKVQtwDd/+SNeURHybCfdXRFdCh/p5G7dyeyZ+VxJecUxr1cB1Tw3n KvZNKr8VzJ/nVsnuOzuMirN8NR1mKYDJuHp+X2t711EdUPKdUf0vjcJZ7hsfw1P/SKCk 9Im911/H6/bnjeRrEMLbcE1bqHQxcvFSoX1eH1MlX2JPGiSLIQePkGy1JMY0XpHhlVFG u86A== X-Gm-Message-State: AOJu0Yyghb2AUGDhliuCAJHv+She7oRGxI66pCZT+AVHufxj9mAEc9jC xvlLRDgsVhmqRk0RxA7umI/qP+iRwkBH0TxcnuExFYlI9hkvxZTEE/2OKiTcng== X-Gm-Gg: ASbGncur2PsdFFs1iE+HIutEMkS0unQ5wPL3dV6VMh9xpjILMQBwEQDFT/gxUKo7zIv izOQTXA0GmG8QhtseI01kvll9FX4/uYtUSRwis5yOqT14dbsiOM/x0jd5JxCIv5uoLkq0w2n5zV jHd7c/1b0F0k1NMZgF4dYHe6yPo8CnKQLlwL+qBXp4mVr4sOYVVjktYPkI8D6JR/h4JjwNYvRdA vIBuknLTQXuzfoCRiA63zUszxpImpdZ//N/fwMRwh3gzVJ9Mje4g61vvFYZjW+Zr3ZlSEM8dgdO uiyPESRmg4Es5bu4+33cgX2RqcKxIrwObYtRf+vSkA7j7AD60p+D03YqtyqyQYpGG3khNFghsVN SRweqKQ== X-Google-Smtp-Source: AGHT+IHyKedh7M5ZbRzdSbSXKO6K1FqcAB4LewggEqU/4nQIy+fFgxSDHwR9CZL3cSccWKA1oFjG7w== X-Received: by 2002:a05:6a00:2b97:b0:742:aecc:c472 with SMTP id d2e1a72fcca58-742aeccc683mr12376224b3a.2.1747614585293; Sun, 18 May 2025 17:29:45 -0700 (PDT) Received: from localhost.localdomain ([2405:6586:be0:0:83c8:d31d:2cec:f542]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-742a970c882sm5254027b3a.55.2025.05.18.17.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 17:29:44 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 19 May 2025 09:29:04 +0900 Message-ID: <7f1761694001e006ee9d878783338af2bc02867e.1747614548.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/system.scm (operating-system-etc-service): Remove block sourcing bash_completion.sh. (%base-packages-interactive): Delete bash-completion. * gnu/services.scm (%default-etc-bashrc-d-files): New variable, which includes the bash_completion.sh file. (etc-bashrc-d-service-type): Use it. * doc/guix.texi (Service Reference): Update documentation. Change-Id: I2223a5f96f5d761148badc6be29e1c5c80465a1d --- doc/guix.texi | 11 +++++++---- gnu/services.scm | 8 +++++++- gnu/system.scm | 10 ---------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 927e9243bfb..746722caa61 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47651,15 +47651,18 @@ Service Reference file-like objects, as can be produced with @code{local-file}, @code{plain-file}, etc. Note that provided files whose file names do not end with @file{.sh} are @emph{not} added to @file{/etc/profile.d/} -and are silently dropped. Package objects can also be provided directly -to have their @file{etc/bashrc.d/*.sh} prefixed files added. An example -usage may look like: +and are silently dropped. The default value is made available via the +@var{%default-etc-bashrc-d-files} variable for users to extended. +Package objects can also be provided directly to have their +@file{etc/bashrc.d/*.sh} prefixed files added. An example usage may +look like: @example (use-package-modules gnome) ;for the `vte' package (service etc-bashrc-d-service-type - (list (file-append vte "/etc/profile.d/vte.sh"))) + (append (list (file-append vte "/etc/profile.d/vte.sh")) + %default-etc-bashrc-d-files)) @end example @end defvar diff --git a/gnu/services.scm b/gnu/services.scm index 7083c88c130..5dbda176b80 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -124,6 +124,7 @@ (define-module (gnu services) etc-service-type etc-profile-d-service-type etc-bashrc-d-service-type + %default-etc-bashrc-d-files etc-directory privileged-program-service-type setuid-program-service-type ; deprecated @@ -992,6 +993,10 @@ (define etc-profile-d-service-type (define files->bashrc-d-directory (make-files->etc-directory "bashrc.d")) +(define %default-etc-bashrc-d-files + (list (file-append bash-completion + "/etc/profile.d/bash_completion.sh"))) + (define etc-bashrc-d-service-type (service-type (inherit etc-profile-d-service-type) @@ -1000,7 +1005,8 @@ (define etc-bashrc-d-service-type files->bashrc-d-directory))) (description "A service for populating @file{/etc/bashrc.d/} with Bash scripts having the @file{.sh} file extension, to be sourced by interactive -Bash shells."))) +Bash shells.") + (default-value %default-etc-bashrc-d-files))) (define (privileged-program->activation-gexp programs) "Return an activation gexp for privileged-program from PROGRAMS." diff --git a/gnu/system.scm b/gnu/system.scm index 0b64927f5ba..50f739c17c7 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -960,7 +960,6 @@ (define %base-packages-interactive nvi man-db info-reader ;the standalone Info reader (no Perl) - bash-completion kbd ;; The 'sudo' command is already in %SETUID-PROGRAMS, but we also ;; want the other commands and the man pages (notably because @@ -1146,15 +1145,6 @@ (define* (operating-system-etc-service os) # Provide a default prompt. The user's ~/.bashrc can override it. PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ ' -# The 'bash-completion' package. -if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ] -then - # Bash-completion sources ~/.bash_completion. It installs a dynamic - # completion loader that searches its own completion files as well - # as those in ~/.guix-profile and /run/current-system/profile. - source /run/current-system/profile/etc/profile.d/bash_completion.sh -fi - for i in /etc/bashrc.d/*.sh; do [[ -r $i ]] && source \"$i\" done