From patchwork Thu May 8 06:02:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42399 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 5623F27BC4A; Thu, 8 May 2025 07:37:51 +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=-7.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_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable 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 9CD3B27BC49 for ; Thu, 8 May 2025 07:37:49 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCuss-0006dm-Py; Thu, 08 May 2025 02:37:30 -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 1uCusd-0006aq-8y for guix-patches@gnu.org; Thu, 08 May 2025 02:37:16 -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 1uCusS-0001ih-Oz; Thu, 08 May 2025 02:37:14 -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=Gny82GpAwaIhnGMjyhFSt4k7Ij6JBS+fmbuhPqYC7ek=; b=Uu5MbXf1yqy3Vf4wJotxCQvtIZYiRYTQkDVGwP68I+wf7kONIIw20y2wkPWAs4gmMBfK04q63KO4udhOCavqsUaIvvy6LHFs2jGG0o8XQAtoROQqoVH5Gb3Tx5xl757aplWKWdMB6n3RJCp9odOAX1T4pyACaA3V8Iq+0bKbXyUDdn1oXMvjT98lTFu324eGXumBW+xRXE7NcenQPDC7wYxVtFoeQSBhNTvtJW1BC6roSjl5AZTlP0i9OT3qhNGfn8lTfptWz9/eFKkNDvjo02IR3/5kNwG+DXK/JmXc3wKq/OfXKJfLL21duHLRpbhuTNqGbeeH01tDqAJzMY+UsA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusR-0000m3-Oc; Thu, 08 May 2025 02:37:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 6/9] system: Migrate sourcing bash_completion.sh to etc-bashrc-d-service-type. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: gabriel@erlikon.ch, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Thu, 08 May 2025 06:37: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 , Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17466861762800 (code B ref 78308); Thu, 08 May 2025 06:37:03 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:16 +0000 Received: from localhost ([127.0.0.1]:52877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurf-0000ix-Bp for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:16 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:57460) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurb-0000hm-Db for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:12 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-740b3a18e26so167006b3a.2 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686164; x=1747290964; 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=Gny82GpAwaIhnGMjyhFSt4k7Ij6JBS+fmbuhPqYC7ek=; b=MpCUdpec/uGLUysMVvrSJ4kPW/wocO70z2diOr9jM9yv2ab436PJnRH37i4b//hfWG 7+n0+bN0X8eW6fLxiTGphvmxnI0DHUdI/PJovJ8PgGoTaLBjMtWwAH+yRk9QLzyNpAMy BcbqZeG4jDtBlNgln6bukdpJIzdpS7YCAOGmbfmH4bFxjtXeZ/3sHgUVU7TgSvxjtwer 6ZjxdrwB/qTwTZQXw+HcDw6ENTwwZyGxatblkGIs3IMvWNr9KrOswsrOhewAZFD8EB6b clW3Klm0kZqlasJ/WMJ4lVI8mVQs3BJjsIjN3OdbWQ9IqfAJB8NzylNZeWdP5FJ4rBXd uuGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686164; x=1747290964; 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=Gny82GpAwaIhnGMjyhFSt4k7Ij6JBS+fmbuhPqYC7ek=; b=bCJrXNKr80BMwQ8CTUkDD8SlbCQAyoCdHv2Bz7m4VkI5QZYZqCqejREpjG791Uvtrz 2yUcCgI5Sz/nF3g40HlzD23ySmCCYNILJ7PB+pSODUQUvrQ2ZIQ6HUQKzogozR5CXMol 4dwr2teZ8n9+NVuQSiON8N4oT4L8wVjGxcPrcpdP6CkqVslPjv0xE8nICJmSpLHqLwbT wTMI0KjBuapFaLxNGFNjZT2WixQJz+SmEZMSrvPPv6RbEdHjEGvlaa+ntGU0LImMyVsn ENpwnFW4wbjrjbaEmVZP8gnxZ10phvtaGD0kM8pKjFsguUNLzDEG7UG8wx2n6hZY8Go3 apKA== X-Gm-Message-State: AOJu0Ywgm7sJAB2523995wFrqsQMDayKZYlPo+Lyi3kkYnCADO5NNhj4 0pVDv3wqbOTiePNt5gHO6GGcvPm99+ZPvnRlxGuDj8uBuw1uMgIN5dbA5A== X-Gm-Gg: ASbGncvVaI6rqhmhidb05QXUS8RGYO3AfReQsIDd7mJcKTGohR4H+dstqCSHc+I7iCG i/1CTvOYP5YvRylITsAkC9Hzw/ENke+PlpA3C0nr+YpL0WHTLA8vtPEWsR4fXO7usm4DcbRh+ic vEbMMUNS9FIiCcqAYWYb4YrYH2blk/Mdk3vb6qPqzdLTWXChJ+NqehMVN2Yfd0hHmIPTimpCjNg 76s6MoX+sIvKrtEOxMf8Mf/ceO6umhoPm9mN+cuBENFZTvogf3fy3StOUTsAwsxCVaB6iHA9Aua CMOsqetUW+9Rli7xMevnfxrYgIZq8mInnIi35p3XAgsuW2JSsCZFrt66LNC4 X-Google-Smtp-Source: AGHT+IETQuiBz3btq044tRk/vDJE32YzEFz/w2gz06wweshXvXeZlBMMnaZHxVIcdeGDo3O/D+IXQA== X-Received: by 2002:aa7:8e91:0:b0:740:afda:a742 with SMTP id d2e1a72fcca58-740afdaae73mr1325264b3a.0.1746686164301; Wed, 07 May 2025 23:36:04 -0700 (PDT) Received: from localhost.localdomain ([2405:6586:be0:0:83c8:d31d:2cec:f542]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74058dc45c7sm12452121b3a.71.2025.05.07.23.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:36:03 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:22 +0900 Message-ID: <93144b9f500318da89c3391ce68f453041fd6afc.1746682206.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 74503ce0e6c..c8d74a3c31b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47540,15 +47540,18 @@ Service Reference The type of the @file{/etc/bashrc.d} service. This service is used to create files under @file{/etc/bashrc.d}. It takes as value a list of file-like objects, as can be produced with @code{local-file}, -@code{plain-file}, etc. Package objects can also be provided directly -to have their @file{etc/bashrc.d/*.sh} prefixed files added. An example -usage may look like: +@code{plain-file}, etc. 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 70f341a495a..d009a2036b0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -959,7 +959,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