From patchwork Tue May 13 02:31:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42569 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 F2E0327BC4A; Tue, 13 May 2025 03:34:01 +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 376B727BC49 for ; Tue, 13 May 2025 03:34:01 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uEfS7-0004hI-Ci; Mon, 12 May 2025 22:33:07 -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 1uEfS5-0004g5-1U for guix-patches@gnu.org; Mon, 12 May 2025 22:33:05 -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 1uEfS4-00084f-HG; Mon, 12 May 2025 22:33:04 -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=K1zgxA3JygQVWUgyv8FXtsicDjog+fJkdeoHSsxm4Fs=; b=qlamRDMc+WuDTvFPUzOU2hHIFsTiqozhSPykd5LL8bs0e3Vty8Ys4hfI9vS/8Yws/k/Jrn/KHGCp3SQYtWlhhS2W78lOehBmKySLxfPGFI5XN7oN9yaPmFF//2ruiqbr9lAUpa8VdlgQgy0ca82veWOTIi9WER0ojdndyFJn0nyZuDqNoWDwWRxVzQU/YMtVIIFhw3R0CFVVXkEq/Tgic3Vvg+lUj5oZGCRJa0Lg1odm+tl/cqmyjWu8gIXUC6ugxFUHsiwKVEgtuVQwgYLb7/bMZoVSvXSRhciokE+ng/8x/olp749M3/OwN3VBkrjIuYFiRvxi1/gfuz8yeT6ArA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uEfS4-0001ib-Au; Mon, 12 May 2025 22:33:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH v2 6/9] 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, gabriel@erlikon.ch, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Tue, 13 May 2025 02:33:04 +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 , Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Maxim Cournoyer , Rutherther , Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17471035626488 (code B ref 78308); Tue, 13 May 2025 02:33:04 +0000 Received: (at 78308) by debbugs.gnu.org; 13 May 2025 02:32:42 +0000 Received: from localhost ([127.0.0.1]:56328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEfRh-0001gZ-Vk for submit@debbugs.gnu.org; Mon, 12 May 2025 22:32:42 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:47414) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uEfRb-0001fS-KO for 78308@debbugs.gnu.org; Mon, 12 May 2025 22:32:36 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7423fb98cb1so3285702b3a.3 for <78308@debbugs.gnu.org>; Mon, 12 May 2025 19:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747103549; x=1747708349; 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=K1zgxA3JygQVWUgyv8FXtsicDjog+fJkdeoHSsxm4Fs=; b=kXNJdB5GuDP8lhNQ3jTXMw2zTYEJkOXamz80568bXPZsfcx93yHUdUtdjPZsIQow5t BtQ9/aZ+ePLKZFaFheOuLU7MnbgBq9QQ/knN0j1QXRc+7RLwvx/+HjIti2c4c77zV3dT g2yGPP7er1t9jPiyO/jXcr8XN7FoRokN534DxK9jb6W9YmftBpuoFVNEQj2MEi+ozzgB bZuZASBmu7ZaWVjx8taAH9i3jcEhdpMnK4/X4dvL1p5Zrqj1it2h33gdxsQCCN2ODfCr xbDezjSGAT50ONQhVOjaG7pAQXmqo3N1tSWMtD5badjmFRgK2gGngp/gkYgmfAh+EJEG 2+rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747103549; x=1747708349; 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=K1zgxA3JygQVWUgyv8FXtsicDjog+fJkdeoHSsxm4Fs=; b=TzYbliZly/jJ6/T+yOWiSaRS+Zv1Xu2N10MtUexNtqI/tWUa7kkokyNLEVAah4g1vs RaaHlhhg5yx8f0tiWaZz8SudSXWY4mc9ZPDhFDTzii46gKvSGVrtOBekgrqcDPXmEJXl 6yVYDJ9JALUir+qahlEtMM93HPKXfAd2ipfNIcq/Qt2O2RS+98Bn9phePsk7aF3iS23Z 1pWaKWWqmIrlsTjYeo6KxGi++AD+NitUT/b/0i7jILqyaYYKzJWsLQRA9tOytAGw12au OC5KbrMjq613xvtmz4yVmGhGE5ouIykSL9saVlSRKVDcYEbUMPLpwBGOQ9mLxbr0IaKo 04ew== X-Gm-Message-State: AOJu0Yxuvo6gj9PLawcK7Xa6y00xN9Nfu8pTdVGBZ9JSRQX8DEsQj2FF T6j9VKxLYe4yGh/o0CVbBGGUutZ7MJG4H9yfOSWZA0H8BWpzbPpdUiC4qa6t X-Gm-Gg: ASbGncs6KlejRd8Ol8A1BKZ6BSXF/Jy4zdobfBUPrgKxMX2LpUCjWhuR7fkz2vg1kjs YbbOBK8+4HWcVkEtmYZVXHkjaGVPvvnhEUOoyeEUXzLr/MMhkZNvda3Y5l3VL70HBG9wuDiZTQA o2XfH5bVfFzLvoSFGFp5nMzbHobxRNhsLRGLeLeuiHPuGDxGrbReVwTye1KCEuCj5AD8n2A3f4I 5DAs+i09i+82icdPetp2xOlH8V2zaQkkzrfcwcf05eW/VXDHInxzWtSARSC0PGdxIAlB6k7GBKl Am3i4drZeYY33L5OJyOtlnNelqWL23DPbhIR3NIp2xzW0upl1NmW7Mz6az/1glHfsp/emRX4JJv saybqXA== X-Google-Smtp-Source: AGHT+IF1azktO6i2DFDWSp85eyLw2wVR9qW/xqNHLp6WWKz9Hfkhi5hzcNNXk8VTu8rJto7HvI+33Q== X-Received: by 2002:a05:6a21:348b:b0:1f5:7b6f:f8e8 with SMTP id adf61e73a8af0-215abb51860mr22693913637.6.1747103549104; Mon, 12 May 2025 19:32:29 -0700 (PDT) Received: from localhost.localdomain ([2405:6586:be0:0:83c8:d31d:2cec:f542]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74237a387a6sm6947460b3a.137.2025.05.12.19.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 May 2025 19:32:28 -0700 (PDT) From: Maxim Cournoyer Date: Tue, 13 May 2025 11:31:45 +0900 Message-ID: <30d609e7beecdee13f99bbc2be247eaa02a72bcf.1747103508.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <5cf9f21c9626bb8c8357089caa747c2ae8ae2fca.1747103508.git.maxim.cournoyer@gmail.com> References: <5cf9f21c9626bb8c8357089caa747c2ae8ae2fca.1747103508.git.maxim.cournoyer@gmail.com> 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 559896ff3a1..28ce18688e7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47578,15 +47578,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