From patchwork Thu May 8 06:02:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42395 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 C42E627BC4D; Thu, 8 May 2025 07:37:34 +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=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 778E927BC4C for ; Thu, 8 May 2025 07:37:34 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCusa-0006Zz-UM; Thu, 08 May 2025 02:37:13 -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 1uCusQ-0006Yb-Eg for guix-patches@gnu.org; Thu, 08 May 2025 02:37:03 -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 1uCusQ-0001i7-2r for guix-patches@gnu.org; Thu, 08 May 2025 02:37:02 -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=vA14hzINEgdqOgPgEkiOmDWluI5LepMv2OVJy1WI8Js=; b=rCxZ1E4DOs1h+LwDsy6y/c63tmIyU4n4hoID/EoLlRxjFcsjfQHo1TwYzG4kq47R7Sk4IqtfGFKcgbHFBH2r8W5VSJgLTpFv8hbt6rNcWim7brW1bUJZP2B1I87eAQxzO2W/X1Z+ibWvF+puZtAgh8ZZGMezejWsvrJ2ZH8UGmMVbkO8wooVfDQy0vW/8FjKQxWj7bI9TXNGN9J2W8STdtjX+gdOkpRXoA38yYYpW9e/DjqAV0A3y+LWAgar5zwYIWFjx178+8USvnYXGH3+CDqJ+HnVebqukdz6iALnRYhRMml5TgMJu5HucJoJGu2fvdTD8xgBbV0Q3ERRNAH1og==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusP-0000lW-ON for guix-patches@gnu.org; Thu, 08 May 2025 02:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 1/9] system: Source scripts from the /etc/profile.d directory. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 08 May 2025 06:37:01 +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 Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17466861642700 (code B ref 78308); Thu, 08 May 2025 06:37:01 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:04 +0000 Received: from localhost ([127.0.0.1]:52862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurU-0000hU-1y for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:04 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:55394) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurR-0000gU-RU for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:02 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-7fd35b301bdso633308a12.2 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686154; x=1747290954; 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=vA14hzINEgdqOgPgEkiOmDWluI5LepMv2OVJy1WI8Js=; b=btBGfAh/S24VCVdA1t6kahG4cIKPs11u+GAE2kdMEVxxEQHeEA6tlQargE7UwSS2xx wnT8UFvaehFcf+bKJ3J8bs4JrV3Ff53XOGp0SIXdODsIziwIsEf3k4E5INiIDcwgLsEW 3skZProN5qZNXcuBXzKsqHwubpoBVRdnPdgqxSG49oQSkUuqu+cCpYSAQM1dKqZhAe5b UCWAZPWOX12rl1RSzpBtoUSCYm2P2JbnlUYdraC4eKCrUC/CTa4hmpenEnrvKTSKOavJ UUggbJHpX2ABqMAWi8QJulF5e7J7LJ9yr/gRZEKBVkPbsEmB0UTezZ0AXCOoNKe8F5Lk NIRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686154; x=1747290954; 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=vA14hzINEgdqOgPgEkiOmDWluI5LepMv2OVJy1WI8Js=; b=qla1MrTY6nTE/X4WZ9PJQ9NiZBL1G7QEEuRcfiqMlng/d2UdwgGgcioyw6LN6bzXkl Q4A9XZoEFkssRNnMNQrfwVOwYXApMqsFokAl9hWOg5hfTuUFetCzVJ6hT+ZojvuCIrCl Y9P2I8OoULsVGHUn8Spm38ig6M2YabOgA6+6tWOYSQWZDtpQjyyzfqWEnK6sj4zGW3Lf +PPLMy8iC1M45dKYmOdnVSSF9+/31ahYUgZjUiaxB2KpniI7kpcxHg1jXxBt4ffmhL3l 61xRxnBQwgpsY8QMgsJ3JGSmemyNMFnKcaMDhWo9C7V7yRzGqUQIV2nnmf7XfX3MTW8t 9tYg== X-Gm-Message-State: AOJu0Yz4s9gpRjfuaJE5K+LH3+jl/eUiPYMRTNp77ttmWRd0ieSYcxQx 11Fbzv4H990HuMSIeNekVwu/JbAsbAHkYkLuuKtK1tGPSW/Gmu46KdkDgQ== X-Gm-Gg: ASbGnctwmSJ5CtDY7gQRi1WCglGJuMcgiIK3iaHvE/3z4E3RLwwQD5tr1J/S5S8xj6Z 9HP983ytuNFsbHXSaGR8xud8e0ahyQjgS+apfcfMBSaUIOxqNK2pf6Rak8WfZGG4ue5f/by9Ebp n7hYBy+9JlgjKJITGT0BYVz5NCiG2iYBibv6ezJ7KsXc9sg2lLgW9QvYh7x0o9+VAbsjIbIGln1 61ePbfw7c7zClqHQsiYJ960YnW7x729iWvJuJ8S0YAP1zH0PwjB9bjer/GZM5RlGhRK4PIqo6ik Gm6va5uskVSAMg7oZzj6vXwSE7fCNUuqr3brYeOjizGnYiqW+LV7nG8Y4NzA X-Google-Smtp-Source: AGHT+IGTQoSz6OxjCFF3g8LxBxzN1kTJ8k5LHedWM48uTMITvZ82ajRq7S4SpFGDjOpfI5mXfn0MuQ== X-Received: by 2002:a05:6a21:32a9:b0:1f5:58b9:6d9b with SMTP id adf61e73a8af0-2148b81ecadmr9220608637.12.1746686154480; Wed, 07 May 2025 23:35:54 -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.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:35:53 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:17 +0900 Message-ID: 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 This is useful since our /etc/profile file is otherwise not easily extendable. * gnu/system.scm (operating-system-etc-service): Source all '.sh' ending files found under the /etc/profile.d directory. Change-Id: Ia6d777195241f69219f00fbd5975e3e6b7c265fb --- gnu/system.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gnu/system.scm b/gnu/system.scm index bc652b1ce59..11ac22da5a0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1122,6 +1122,17 @@ (define* (operating-system-etc-service os) # Allow GStreamer-based applications to find plugins. export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\" +for i in /etc/profile.d/*.sh; do + if [ -r \"$i\" ]; then + if [ \"${-#*i}\" != \"$-\" ]; then + . \"$i\" + else + . \"$i\" >/dev/null + fi + fi +done +unset i + if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ] then # Load Bash-specific initialization code. From patchwork Thu May 8 06:02:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42396 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 6F83A27BC4C; Thu, 8 May 2025 07:37:35 +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=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 6CD9C27BC4B for ; Thu, 8 May 2025 07:37:34 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCusY-0006Zf-Ng; Thu, 08 May 2025 02:37:11 -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 1uCusT-0006Z3-0F for guix-patches@gnu.org; Thu, 08 May 2025 02:37: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 1uCusS-0001iW-8I; Thu, 08 May 2025 02:37: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=NAuAEev3j6+ljyF5wKWcQu6KtEfQre7Sm97aiwdDhXI=; b=nlzl+n0w7899D+3BihoeRUSJx+4aZ1OusoacOCMWs1bjP7hP7FXz6jwO3WM/FC7KFVh1PETmwQ0s9VMGPHi2XJyoiZxO/KQ4yVR6UqcpesKy3hs182qorNFziM86myzSVnGzeQGAqQk1H/beKTT1Aj3wsa4EG0jV6RXODXEg8OjmWhRHeBfdkwpeucP7jsc+hQi5nzbIwmKseNAG6GUxVewqporG0F/ePndlkEFPFpY37yZlIEV2smuJqxYGuwqHxAhuiQez8cGggGlnJHuX9/lylmO4PxlTEJLoefvoZX4yLFZ5GNqfbZI8FQb5ZTLd158iB6MQiF+YH88SGMFb1Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusQ-0000le-9J; Thu, 08 May 2025 02:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 2/9] services: Add etc-profile-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:02 +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.17466861672721 (code B ref 78308); Thu, 08 May 2025 06:37:02 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:07 +0000 Received: from localhost ([127.0.0.1]:52866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurW-0000hp-Dk for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:07 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:46454) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurT-0000gf-1E for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:04 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-736b98acaadso690160b3a.1 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686156; x=1747290956; 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=NAuAEev3j6+ljyF5wKWcQu6KtEfQre7Sm97aiwdDhXI=; b=jH2SRHvaTjFrRJ6c5dfwciwy6nQzNHOMNRg+NEzUGJRvmuWRfGxQ2rvIJo2b86j8Xq xoKO0tO2+0WKbdb5WeFrfTA4d/rWIv0GzuRM5+XrTtXqYjNtcc+/kuBjocfwod46MycL swR7ZOBH7obt25uTMwNTuD5zqaDjw9ziCEFd1L18ueO0xYRAcTKq9/8LRr086ovmCglG 8liAKl62tqtJsARYB2bO8xr3QwyGl5gvBp+f2INR/M5STQmaAHT4iZVr+WjlcCEzH6l2 i5QreMB0keJCLuscgUbR/bJEP43pvLXK91/2eZik6cc9frUwU3qRZmOAz28alFECcRle 2+9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686156; x=1747290956; 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=NAuAEev3j6+ljyF5wKWcQu6KtEfQre7Sm97aiwdDhXI=; b=ABcB9xng4jFmXDLJwSG/+H5J/U1pNQu7hOHMcUngdrMEZi8QWF0yamEZajaKJ9pttO xTNRnFuOD2E+O1BthwH6J2IkaYLhi6tK3hxAxwBun49SxxyGFRA/eLoj3kJH2gYb3+qD iv96deZWJsWSignkTggfBjEN2Il4pGc2H1NhHDFKRMuQBNNZnyE9H7uN0EOH+MccA5cQ IOGyc6kZ7KS3cB7MpEVo1YzlycpjZg9ePF6/HGj7JiEVDT+FqnwFLfZWnja3w0fkRlyv d2jSMgIU6cBoRWZ3Cc4B0qrV1UpaHhl55m8PR2u06OKXBqH4AbH/GhkGUryMUtH6De1w ErmA== X-Gm-Message-State: AOJu0YxOEaQxTsRZOiLRHy/rjKOrNsmjeFv96fDOMjpt9hrNVNboqzu+ o8w1tmurmHq3qBe9oe7VJnsu0Pw3Cvh3NyxyMS61L0F0rkGBpFRFDOGZZQ== X-Gm-Gg: ASbGncupFKgCOqHRI9YvYDrgQcQ5QxmGl0LGLuah96bKFRX+GplrF8w7KK3IvqxM6+o xIYqnWIJSHJ8q/RJ8hD51oEpdJe4hSnHaApiH87laOq2vPIRqiKvaiBIy2Z1OgebD+MXwMtbH5Y xeKcfZxkOMuPHY+UHZ+GJZ7KsanRVg5mcgsZgevLM0XvqQ5hLxPIKt9OPDxtYPR7XbxR5MI28BN x2UIDMtwHAZ2raO4PGWBkhRptbYnEcc9xdeM2OVxHNtD7YkuKwr/bSOxe6NX51C8MuPA5QRN1Rg SRVrKRwipRWmSiH7mi5X5bz3af0ny50fDPN18HSfHPnZOChYuwhSh0NvfTS9 X-Google-Smtp-Source: AGHT+IF+NlHRTPhpz0r7g4lDG1pFu+mplR6GiXfABxlV83TYPXDlgB65l0/vFgpvlytnqOLXQl6SOg== X-Received: by 2002:a05:6a21:9002:b0:1f5:7873:3041 with SMTP id adf61e73a8af0-2148bc0fccamr9907046637.18.1746686156436; Wed, 07 May 2025 23:35:56 -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.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:35:55 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:18 +0900 Message-ID: <96db80de431149cb07171ce517d37330719fbbba.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/services.scm (make-files->etc-directory) (files->profile-d-entries): New procedures. (etc-profile-d-service-type): New service type. * doc/guix.texi (Service Reference): Document it. * gnu/tests/base.scm (run-basic-test): Test it. Change-Id: I45dde43a1b9603c3384b933ebd1d6e45dba146b9 --- doc/guix.texi | 14 +++++++++++ gnu/services.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++++ gnu/tests/base.scm | 21 ++++++++++++++-- 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 889eab2ab35..05124e8ce6f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47522,6 +47522,20 @@ Service Reference pointing to the given file. @end defvar +@defvar etc-profile-d-service-type +The type of the @file{/etc/profile.d} service. This service is used to +create files under @file{/etc/profile.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/profile.d/*.sh} prefixed files added. A simple +usage may look like: + +@example +(service etc-profile-d-service-type + (list (plain-file "HOW_IMPORTANT=very"))) +@end example +@end defvar + @defvar privileged-program-service-type Type for the ``privileged-program service''. This service collects lists of executable file names, passed as gexps, and adds them to the set of diff --git a/gnu/services.scm b/gnu/services.scm index af054339fd9..8584b16ac5c 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2022 Tobias Geerinckx-Rice ;;; Copyright © 2023 Brian Cully ;;; Copyright © 2024 Nicolas Graves +;;; Copyright © 2025 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services) + #:use-module (guix derivations) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix store) @@ -120,6 +122,7 @@ (define-module (gnu services) special-files-service-type extra-special-file etc-service-type + etc-profile-d-service-type etc-directory privileged-program-service-type setuid-program-service-type ; deprecated @@ -926,6 +929,65 @@ (define-deprecated (etc-service files) FILES must be a list of name/file-like object pairs." (service etc-service-type files)) +(define (make-files->etc-directory name) + "Return a procedure that accept a list of FILES and compute a directory named NAME. +The returned procedure FILES argument can be packages containing +@file{etc/@var{name}.d/@var{x}.sh} scripts or single file-like objects of the +@file{.sh} file extension. The constructed procedure returns a list of +two-elements list suitable for extending `etc-service-type'." + (lambda (files) + `((,name + ,(computed-file name + ;; This is specialized variant of `file-union'. + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 ftw) + (ice-9 match) + (srfi srfi-1) + (srfi srfi-26)) + + (define sh-files + (append-map + (lambda (f) + (let* ((dir (format #f "~a/etc/~a" f #$name))) + `(,@(if (file-exists? dir) + (map (lambda (x) + (list x (string-append dir "/" x))) + (scandir dir + (cut string-suffix? ".sh" <>))) + (if (string-suffix? ".sh" f) + (list (list (basename + (strip-store-file-name f)) f)) + '()))))) + (list #$@files))) + + (mkdir #$output) + (chdir #$output) + + (map (match-lambda ;XXX: adapted from file-union + ((target source) + ;; Stat the source to abort early if it does not exist. + (stat source) + (mkdir-p (dirname target)) + (symlink source target))) + sh-files)))))))) + +(define files->profile-d-directory + (make-files->etc-directory "profile.d")) + +(define etc-profile-d-service-type + (service-type + (name 'etc-profile-d) + (extensions (list (service-extension etc-service-type + files->profile-d-directory))) + (compose concatenate) + (extend append) + (default-value '()) + (description "A service for populating @file{/etc/profile.d/} with POSIX +scripts having the @file{.sh} file extension, to be sourced when users +log in."))) + (define (privileged-program->activation-gexp programs) "Return an activation gexp for privileged-program from PROGRAMS." (let ((programs diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 20fc848e5ce..988212b4a7a 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016-2020, 2022, 2024-2025 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur -;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2022, 2025 Maxim Cournoyer ;;; Copyright © 2022 Marius Bakke ;;; Copyright © 2024 Dariqq ;;; @@ -170,6 +170,14 @@ (define* (run-basic-test os command #:optional (name "basic") info --version") marionette))) + (test-assert "/etc/profile.d is sourced" + (zero? (marionette-eval '(system " +. /etc/profile +set -e -x +test -f /etc/profile.d/test_profile_d.sh +test \"$PROFILE_D_OK\" = yes") + marionette))) + (test-equal "special files" '#$special-files (marionette-eval @@ -563,7 +571,16 @@ (define* (test-basic-os #:optional (kernel linux-libre)) (let* ((os (marionette-operating-system (operating-system (inherit %simple-os) - (kernel kernel)) + (kernel kernel) + (services (cons (service + etc-profile-d-service-type + (list (plain-file + "test_profile_d.sh" + "export PROFILE_D_OK=yes\n") + (plain-file + "invalid-name" + "not a POSIX script -- ignore me"))) + %base-services))) #:imported-modules '((gnu services herd) (guix combinators)))) (vm (virtual-machine os))) From patchwork Thu May 8 06:02:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42397 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 1892327BC4A; Thu, 8 May 2025 07:37:46 +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 783C627BC49 for ; Thu, 8 May 2025 07:37:44 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCusX-0006ZS-8d; Thu, 08 May 2025 02:37:09 -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 1uCusR-0006Yk-6d for guix-patches@gnu.org; Thu, 08 May 2025 02:37:03 -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 1uCusQ-0001iI-U5 for guix-patches@gnu.org; Thu, 08 May 2025 02:37:02 -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=0MLMMcxxWctW/jlInP2ZCILiRjJc3AJ1xuGwWzje7Pc=; b=Trxn3FuJGy5Q2pZZp4FtGCofddywtb/XDp1kL2tjUqZWMe+7f9h+n7ja+h7KWHVSYkQCWpU0xauQ8E69Be9yDEkxehz8O3ZNcqCd+O6ZgWCO3pzdgdfU3Xoy5lFANu7QDoy511wrNT4xGO4j2RuHOu2xVf5nQYmN+nhH2Qdyh9AxcMnCuJfkTXQcRnXK14hyab3pHJwUy3mKjywR6K/AgnProBF5X7dQJj0dVq9+wzl57jeCJyREAid0exVw9/aNL44d/SRkHUelbHeUOps6nZaXwoDElOVMNwyyDodmDEEqTunjGX4M3Vgqs+UMFm6jHCm3GT1liEwK20CbBOxGCQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusQ-0000lk-OL for guix-patches@gnu.org; Thu, 08 May 2025 02:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 3/9] gnu: bash: Define the SYS_BASHRC macro. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 08 May 2025 06:37:02 +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 Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17466861692733 (code B ref 78308); Thu, 08 May 2025 06:37:02 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:09 +0000 Received: from localhost ([127.0.0.1]:52869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurZ-0000hz-5q for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:09 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:61869) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurU-0000h2-Vz for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:05 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-73972a54919so673936b3a.3 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686158; x=1747290958; 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=0MLMMcxxWctW/jlInP2ZCILiRjJc3AJ1xuGwWzje7Pc=; b=cJN6GoliJi+FCkPJVXhoBM/vFZh6iu/hicqs426cVML1UUg8v4G3xOl6IEzhwzNdWK 6tksmSbYebntvTds8Ic3JNHhnrpOzTnunwWskrkXKLlB5aUkfocHp1jc374FmDwSGsqq SlK9sImaBfqyNruH3CxXHHd28jG5Pw/qb/sKTN3n0MtGkGHvew1+/DLAA5fUDUZtseFz /ntVnHpo09eA6aCPCDnB5uzQS3b5+p25u4QM6wFBtPV/085aIYDZLxleY2aVMRXlwUVD 6mNCRSHDCFMP4ZwCDFL/xidsPzJoGF5wgmfMO2NakRXVirxUmnnoyEVI7G2jLQ1LcYUc fgQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686158; x=1747290958; 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=0MLMMcxxWctW/jlInP2ZCILiRjJc3AJ1xuGwWzje7Pc=; b=nfTTR/cS5sk++EN81NEIYhI0tpcoCx79E4IZ9ul4D3+/Mhd2nxliTOj7DqX08rF1jo DO52I3bTcdzSVECnRMyy175ARKvjFwPWkiJlAgZfQBKmjzsy2S6ZvjEFpPi1vAisvWI3 4V7hoSYxNphI593v6AQOGqyvx6nDheVpfLBz8n0A7FD2VZYV1aUmbQBnHIMStzAssUIV 8KfU5/aY2a0nhgjo1qhaXMJXzIOZk6hso6JtuOb9ufhHT2+1dFM/K0oXBrr/fnqvZuHl a9FyOXyjKOSiTsgPTCBXGeBxcasL7RcHOlGMg5L4AnBKsdyMfVIqC5c+02zBXv2OQedN 3saw== X-Gm-Message-State: AOJu0YySAg1hPSQZeQcpWMRrSLmAkHwxuUx1YjO9l5vTcufHCRebOOdK TCeqjsV6PHonNkaDhHwQ8QRDeEgdGSzpHfmwwqIeH7kAo4nfWpcXl72aWg== X-Gm-Gg: ASbGncvwHupbqXqM/SsZFGOJvQMVuC51rqNGQ39UArxtSV5/qvIIi4i7Nd3oa3GcDuL yQ4MME0HqGy8hL7FG6BIyovj5HjtCF7O3z0cbOiFKiD5erG1LCr3DfJ6wnjLmQQBoPt6idQyihL 8HZiOrDD24yEzwPhTSiPjEJuPHr5N/m6vjz0CYORN+oyPJdnPglgobyAeC/3/ifhcJVcXRyEOkB Sb0nsieROm+uj2EuekScUCLlrRWIq5fXntuhIYngX0B4Hi3bu0WJxg4aDnlUoF8myuyajkBr5Ib BI2HvKOqKRJXJi2AKeEWsQFe/XSdf5QRTfCpLwUyoH0pae6doUIcE2Odi/1V X-Google-Smtp-Source: AGHT+IEhCWFlLV9ogBetNKiLWO5aAPUgHGelTgiUxooZ0PmNTjBulFWyUoj0AI924V/BEiBs0bd94g== X-Received: by 2002:a05:6a00:2791:b0:736:339b:8296 with SMTP id d2e1a72fcca58-740a9a589e4mr3326000b3a.18.1746686158495; Wed, 07 May 2025 23:35:58 -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.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:35:57 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:19 +0900 Message-ID: <7e0d4c975862569cb0433e55e4ba9ebb7bdfc4d1.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 This causes Bash to treat /etc/bashrc as a startup file, removing the need to source /etc/bashrc from ~/.bashrc. * gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC define. (bash) [replacement]: Use it. * gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done implicitly. Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0 --- gnu/packages/bash.scm | 20 ++++++++++++++++++++ gnu/system/shadow.scm | 3 --- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index c88f38f5376..bcd78d7d2a9 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2024 Oleg Pykhalov ;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; Copyright © 2024 chris +;;; Copyright © 2025 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -137,6 +138,7 @@ (define-public bash (version "5.1")) (package (name "bash") + (replacement bash-fixed) (source (origin (method url-fetch) (uri (string-append @@ -254,6 +256,24 @@ (define-public bash (license license:gpl3+) (home-page "https://www.gnu.org/software/bash/")))) +(define bash-fixed + (package + (inherit bash) + (arguments + (substitute-keyword-arguments (package-arguments bash) + ((#:modules modules '%default-gnu-modules) + (append '((ice-9 receive) + (srfi srfi-1) + (srfi srfi-26)) + modules)) + ((#:configure-flags flags) + #~(receive (cppflags flags) + (partition (cut string-prefix? "CPPFLAGS" <>) + #$flags) + (cons (string-append (first cppflags) + " -DSYS_BASHRC='\"/etc/bashrc\"'") + flags))))))) + (define-public bash-minimal ;; A stripped-down Bash for non-interactive use. (package/inherit bash diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index d0f1b6b2b14..50ac102707e 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -164,9 +164,6 @@ (define %default-bashrc return fi -# Source the system-wide file. -[ -f /etc/bashrc ] && source /etc/bashrc - alias ls='ls -p --color=auto' alias ll='ls -l' alias grep='grep --color=auto' From patchwork Thu May 8 06:02:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42402 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 9E03D27BC4A; Thu, 8 May 2025 07:38:00 +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 9DA8E27BC49 for ; Thu, 8 May 2025 07:37:59 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCuss-0006dR-EJ; 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-0006am-7c for guix-patches@gnu.org; Thu, 08 May 2025 02:37:15 -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-0001ic-M5 for guix-patches@gnu.org; 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=C2/+54oeSHiFL635iHL653QQVR3rS15iAVzE6Alm5A4=; b=fDZkOT1rC0q/lP9mS1+nFeGKGlq8QDwuqnL6oM7YR/4U6SrgJw5FxmrPSdSSf6VFVub4xZkgOwO4Ql+gG/B+d5fso0vdFpQslk4x7kS4p4Tzz/eCZRyuHEzV3JCfn/PiyxjStukyM1KjlWgPgvOiDmkLnJRuLvYN2xkpnXVzwLOeCEZF0ilT4znYlNVdqRoD5g1mexAjz2xBr2NS0ty8Fbw0Xeq45SsWQrYi+QN3ReMdazrABWKKDLyxnnytBJXnckrtYY2gIePtgyV+ibdKVfbASAHNW4qnLi/xSaQKShW4tO2pBLI0Tci0yABvMUApzdxxdUZMTcwjgRK4Yaae4g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusS-0000mD-9J for guix-patches@gnu.org; Thu, 08 May 2025 02:37:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 4/9] system: Source scripts from the /etc/bashrc.d directory. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 08 May 2025 06:37: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 Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17466861772817 (code B ref 78308); Thu, 08 May 2025 06:37:04 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:17 +0000 Received: from localhost ([127.0.0.1]:52879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurg-0000j7-BQ for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:17 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:57704) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurb-0000ho-K6 for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:12 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-74019695377so518427b3a.3 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=C2/+54oeSHiFL635iHL653QQVR3rS15iAVzE6Alm5A4=; b=AI3ERecqV8i1JPrcYroG0JtKicJy00pBYcFIARjIiwQY8+xkEChy/8gjWOjJ+QONMu aBcI+x/sfkC64BeZof2lb5MSJ5ymJo4l6B68v6MS2TVtj93ai+j0jjqPIEwx5NOf2d7K a3ehM8AsGeODc8E3Yf7N5DJoccilgTQ3hfE5rhD0b5GEWrfUxnO4UaInbstoYb67eBrP Nz+Ls3xfK9GRbxN5DiAsV/36HRq4N+cX3B9BaMJ9iWRU1ZiEFtSvJjmKubztT/uw+Yb/ de/ycPkYkKLqxTfdM3s/X+OgqqrWpyi+hMzckn7Rbh9/MtiVBqeF1HyOJZuMx/N8JIeH o8tQ== 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=C2/+54oeSHiFL635iHL653QQVR3rS15iAVzE6Alm5A4=; b=fQQDsGgyXAS5vGTEQrGVZUh/kH/Cfr3JUZX7AOr+nfiXQanOJWyCdGvO8dd39w/guF JpL1XPMKyHudNqxNfu5VgVHg7R1P82Q68bv84gwgcn5lrpx0dbOadqSIhaCYRxlGhx+x fK5YvbwfZ2VMfbFrBehPm6mfj6bSIT4NRkET6reMmBdFjr5MnePivfcaU5IOMOQ3pXsR A6PC6jgmbHqyvMrozseja6LNNGozlofD6wp095LqZAlwI9YHJDqANpoP2ZdrXaxB3v3d 2hbTGvnrlt8/dM1ARu/AuVr+QH0DYYfJoZAdPsxdVEi3me4a+JAgTwDhLzbsvDtCuAbF dmxg== X-Gm-Message-State: AOJu0YzxAMccHpLyDkCgqvAJhTqhJEwYrId40aPyZniS95heSjps4VcL OfMNCY8KIcVmHajCQ2I4RnmCWl90uMVW6dCirfAqhrQtpBLCorwnZBcPAQ== X-Gm-Gg: ASbGncukYMWMBaEUQai5HFmjOIzOuAHCB6VHBZ7/77tsi7gIskIawFHc2hTQXW/RUXk /LvF6HFGNwxat58CCBGpOZsCEkNREmZ/oe4pU9C+ByICq/42ntLgN9QWu85Wigo+9m1La7NNE/x 6nPphiv2HPKCHHpTu2L0dyIIxfxSpy6fMFZ21WwIR7KCVmZ/TxLGKeboC7qYEMl43jJytUtQqiG dDjkN8HWzUHSbUIpyL7LJakULNAoEG+ezg82bmJvn7jbD0BgHfZYTZNZ/2qRVtRVAtgFoGKyXXN foTLXdPd+sUeSv3qaqzaO3iBUg3DPagdkh4ZAlhLh89MEVXuNFMsc0cT9wRq X-Google-Smtp-Source: AGHT+IF4BZNG+SASZnFMmu5gzRxwS6hfOFnIByN6bpjah0YN9hQrBbSIvoZ5NZ4HZPv6/227cJdOgw== X-Received: by 2002:a05:6a00:2c86:b0:740:a023:5d60 with SMTP id d2e1a72fcca58-740a9a68b3bmr2977671b3a.19.1746686160402; Wed, 07 May 2025 23:36:00 -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.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:35:59 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:20 +0900 Message-ID: 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): : Source scripts from the /etc/bashrc.d directory. Change-Id: I27a20a8eae5d736f32e0df55a68529d9bb613b7a --- gnu/system.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 11ac22da5a0..70f341a495a 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2020 Danny Milosavljevic ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2020 Florian Pelz -;;; Copyright © 2020, 2022 Maxim Cournoyer +;;; Copyright © 2020, 2022, 2025 Maxim Cournoyer ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen ;;; Copyright © 2020, 2022 Efraim Flashner ;;; Copyright © 2021 Maxime Devos @@ -1153,7 +1153,13 @@ (define* (operating-system-etc-service os) # 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\n"))) +fi + +for i in /etc/bashrc.d/*.sh; do + [[ -r $i ]] && source \"$i\" +done +unset i +"))) (service etc-service-type `(("os-release" ,os-release) ("services" ,(file-append net-base "/etc/services")) From patchwork Thu May 8 06:02:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42398 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 4BC2F27BC4B; Thu, 8 May 2025 07:37:48 +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=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 B2DA427BC49 for ; Thu, 8 May 2025 07:37:47 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCusf-0006b0-GH; Thu, 08 May 2025 02:37:22 -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 1uCusS-0006Z0-HF for guix-patches@gnu.org; Thu, 08 May 2025 02:37:04 -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 1uCusR-0001iQ-Fd; Thu, 08 May 2025 02:37:03 -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=QBCOY8S/64W086HeEkt/imKkTN3Sf3gXU+nRf8YyGOg=; b=PD9Srw4i0FgGFMTA0VNNVzNLfubw1jJjJit8PV25OtmqmOKlZMhuvMmjmm5wHnsAgllHdw462l8c6JrEGlW5Nn4v10rU87uZEJgXWb0+A590G1skLCfZheWyhfdHlC8uGjqvUQjZniW7VIBZ90W0HXd4z34NLhaeg40H+VGDl8cwb0mmGVeI5UArgYF2xgj+aWIdVNIxCqdd2vE8oS88A87agpfEIOb0/z69z+zGUfvdsjZIv5fjH9Dg8eM/Z4UQLfNh+gQbDhElVP5GgEtD2gBFqT4A0dqH84VbZNrrqswyuQ3UG7IJZ27+3qAjyDGwBuKCIlxR3W/Z9ERLD1phKQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusR-0000ls-7e; Thu, 08 May 2025 02:37:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 5/9] services: Add 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.17466861732766 (code B ref 78308); Thu, 08 May 2025 06:37:03 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:13 +0000 Received: from localhost ([127.0.0.1]:52873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurb-0000iI-QC for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:13 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:47270) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurZ-0000hS-09 for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:09 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-739be717eddso563566b3a.2 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686162; x=1747290962; 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=QBCOY8S/64W086HeEkt/imKkTN3Sf3gXU+nRf8YyGOg=; b=K3NJLhUAEErsFzof4XL3DXm+mLr5TAmGdx+bk66UKQt9RVYInaRLxjWq6AqA8n15hj N8iMomfemLw75y9BfrmETkoI7NIkJMmUCS3O5/o6JK34p5KfB2zmxQRPMQi6KBKbx43H aKB0/QlLr5JbUu7wUizfS6wYmDNiUu1mkw3dZwvuc+OjSlqnrpy8yAOJXOT+0wkMFL7D vyJbpImaRJcZ5p27b1dxj2iskNmI0TSKgrgR/6Y22AuhDgHnR+awOOwT1cIMT7/bOS7A 21G9T8eqvOieNMRrvTqE3aLKjdZD3k94hQpheSQt9ITo81gJLiz84NY2bcwWOxpB8vTu oy+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686162; x=1747290962; 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=QBCOY8S/64W086HeEkt/imKkTN3Sf3gXU+nRf8YyGOg=; b=oGLY0/zczJI+KHBpanK0Zk8EHF3j08sWVUGz4CcKR2tfPdlwCigW7Lc6+TmXEVXybA tNq1ivs1GA87BP/GHrCVMZcOUfbCG+4CCCwTgiGXWtzClNs9q1GnFpSu2ZmFTTRzWGNU bS+ZNbdwM2XxaTUhZ7T/k/j4teB386l37NHfVkxZvUM45L/yiznDyueWfUrcDe6Qw4oa 0h4EU7wLcGtIhDPHGgGi/P9Hhzns/ZpOEi145L2kNV+qTPD4TDdW9XyTzaEdVPpKkng6 LCwUCFfuGfeQmsU+gTFBqgTm0ASfdugHdFRyx5gTtrJcFhr2ZYOqVN5lXb9NmBQ8UPBA LliA== X-Gm-Message-State: AOJu0YyCqUkDVEAWXX/eZvV5kWuQd6H9wponPAAKz+jG73MkagHhnz65 lU+hD2A3SSlkivOQ7FKpBJgkaKGoYWOvKKQtKfQ0gCHb286L3D2Keb7JZw== X-Gm-Gg: ASbGnctW56nJatFHrBJBJ0NTSKJStJ7KvZf9kBqu8MOvplNg9FOn8Yl5+HhXn9rdQ9L kmuGJCrUOjYkQdc9Sy+hkrGfCypg8UT8ZW9RUsg8+klVDNdYXjt4XrRGasL0mdL3bBwWXeb3wH1 ZBt5ZmRGH7DPVdVwnyx/2jJTmx6pRbMcLdQ/GMzNM4amQzFv5a1HxNkb7tkR/ecD5YooKuNJ/92 ZTUfz8nbmdXRVreBl14pnRobnebmaiuTogxAeohRgaRZuPs4jAtXg84deS2eQBffafb5i7O7z39 8++4FgrJkecVVYfAYU1j9jLEKhHh4MPNrTPeQxGIWr8d2leG+UE/342g8u/y X-Google-Smtp-Source: AGHT+IH7BLLtzgZ9JhzSHnghdyrfzABzPWklAZwpZtaUlO5KLPpTQmpCmL4L+AuAHW51QUg2qiUx7w== X-Received: by 2002:a05:6a21:4581:b0:1f5:7ea8:a791 with SMTP id adf61e73a8af0-2148ba2577fmr8913211637.10.1746686162360; Wed, 07 May 2025 23:36:02 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:36:01 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:21 +0900 Message-ID: <55fa089568d524e9aaba9416fdddd441b2b06919.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/services.scm (files->bashrc-d-directory) New procedure. (etc-bashrc-d-service-type): New service type. * doc/guix.texi (Service Reference): Document it. * gnu/tests/base.scm (test-basic-os): Test it. Change-Id: Ibbb0f684de7aee296adedbce5b1192786d661af2 --- doc/guix.texi | 16 ++++++++++++++++ gnu/services.scm | 14 ++++++++++++++ gnu/tests/base.scm | 39 ++++++++++++++++++++++++++++++--------- 3 files changed, 60 insertions(+), 9 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 05124e8ce6f..74503ce0e6c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47536,6 +47536,22 @@ Service Reference @end example @end defvar +@defvar etc-bashrc-d-service-type +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: + +@example +(use-package-modules gnome) ;for the `vte' package + +(service etc-bashrc-d-service-type + (list (file-append vte "/etc/profile.d/vte.sh"))) +@end example +@end defvar + @defvar privileged-program-service-type Type for the ``privileged-program service''. This service collects lists of executable file names, passed as gexps, and adds them to the set of diff --git a/gnu/services.scm b/gnu/services.scm index 8584b16ac5c..7083c88c130 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -123,6 +123,7 @@ (define-module (gnu services) extra-special-file etc-service-type etc-profile-d-service-type + etc-bashrc-d-service-type etc-directory privileged-program-service-type setuid-program-service-type ; deprecated @@ -988,6 +989,19 @@ (define etc-profile-d-service-type scripts having the @file{.sh} file extension, to be sourced when users log in."))) +(define files->bashrc-d-directory + (make-files->etc-directory "bashrc.d")) + +(define etc-bashrc-d-service-type + (service-type + (inherit etc-profile-d-service-type) + (name 'etc-bashrc-d) + (extensions (list (service-extension etc-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."))) + (define (privileged-program->activation-gexp programs) "Return an activation gexp for privileged-program from PROGRAMS." (let ((programs diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 988212b4a7a..edb7e9112ba 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -178,6 +178,19 @@ (define* (run-basic-test os command #:optional (name "basic") test \"$PROFILE_D_OK\" = yes") marionette))) + (test-assert "/etc/bashrc.d is sourced" + (zero? (marionette-eval + '(system* "bash" + ;; Ensure Bash runs interactively. + "--init-file" + #$(plain-file "test_bashrc_d.sh" + "\ +. /etc/bashrc +set -e -x +test -f /etc/bashrc.d/test_bashrc_d.sh +test \"$BASHRC_D_OK\" = yes")) + marionette))) + (test-equal "special files" '#$special-files (marionette-eval @@ -572,15 +585,23 @@ (define* (test-basic-os #:optional (kernel linux-libre)) (operating-system (inherit %simple-os) (kernel kernel) - (services (cons (service - etc-profile-d-service-type - (list (plain-file - "test_profile_d.sh" - "export PROFILE_D_OK=yes\n") - (plain-file - "invalid-name" - "not a POSIX script -- ignore me"))) - %base-services))) + (services (cons* (service + etc-profile-d-service-type + (list (plain-file + "test_profile_d.sh" + "export PROFILE_D_OK=yes\n") + (plain-file + "invalid-name" + "not a POSIX script -- ignore me"))) + (service + etc-bashrc-d-service-type + (list (plain-file + "test_bashrc_d.sh" + "export BASHRC_D_OK=yes\n") + (plain-file + "invalid-name" + "not a Bash script -- ignore me"))) + %base-services))) #:imported-modules '((gnu services herd) (guix combinators)))) (vm (virtual-machine os))) 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 From patchwork Thu May 8 06:02:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42400 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 2AF7627BC49; Thu, 8 May 2025 07:37:56 +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 EB2E627BC4A for ; Thu, 8 May 2025 07:37:53 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCusu-0006ei-4b; Thu, 08 May 2025 02:37:32 -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-0006ap-92 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 1uCusU-0001io-0j; 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=z21uB993j4dVdzMeYJS6QbrKs8VOIHz2SU8nhZCGE64=; b=fRBk8IdV/dWBzQL6XewLUSZ7hwEbcMClJZifxYkhelONhvxvvLDlapRZWX3wZCwgTWcNt4ayVs7E9QmPprIPyRQEShzWgihGycS7gTA8iA1sHluMT2By2i9R2avPTPU7C12oooqlOoFeNop4P5UR4nTaEGhjVYRResNfykKG3TcTVu9gftAgWIyUfg6cpt8t8x4IkNSM9C8xG4AF0UuM6dVfFEB/fOeloRcKXg5l0DfqsWtJCgKxhmYP/zbQ4S8v5ETPVY96TwKZ+vaR2LbPG8A/OBdQXZy/pHNDs4gJhY7cwdhJxPtpWduML0/FqbhTkszqb910vIYUwwkuIXlQ2Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusT-0000mS-7P; Thu, 08 May 2025 02:37:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 7/9] system: Factorize bashrc default configuration. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, gabriel@erlikon.ch, hako@ultrarare.space, janneke@gnu.org, ludo@gnu.org, maxim.cournoyer@gmail.com, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Thu, 08 May 2025 06:37:05 +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 , Andrew Tropin , Gabriel Wicki , Hilton Chain , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour X-Debbugs-Original-Xcc: Andrew Tropin , Gabriel Wicki , Hilton Chain , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17466861822836 (code B ref 78308); Thu, 08 May 2025 06:37:05 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:22 +0000 Received: from localhost ([127.0.0.1]:52884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurk-0000ja-UD for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:21 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:50380) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurd-0000hx-HX for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:16 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-73bf1cef6ceso749809b3a.0 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686166; x=1747290966; 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=z21uB993j4dVdzMeYJS6QbrKs8VOIHz2SU8nhZCGE64=; b=FgvfYl6y4jCcBQNvJwFi5nnMYbqPzQHY9v4UGGtO6/b6FEhjnDhb9SNffFNt+NXH6U 4pWZavhJmprLG2SInuYqd0GyKLcoqAXfHJ7W+/CAm1YamSj2TzXm2dJ/3wVtQCpTgMzT BjDjiF2CD1K/i41Xyna205lJjDPLftr8YQ07fpPITNrXiJVAyrsCBl/yfgxT83NMZ5Wl kHMRc3fIWjoVtVoRyKmQnU3xb5MDlDRTQvNKjRpO/jLuIm/wukLccp0ertyiFXD1mvAg 6HvFsWk6TXZWZZAc60y4BWm4LpRKPSQ+JBW/dJEYxhEvyIThRFD5gmDTNW1cZoTjezGF vpMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686166; x=1747290966; 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=z21uB993j4dVdzMeYJS6QbrKs8VOIHz2SU8nhZCGE64=; b=Cvtc85NdbPESKwNBchsbSEyyKMfde2BSmzQi7Xikn10p5f9kD7Q4igO39WpDy8Ha6L DzRUQlDIG057fBsPN7peQE6/f4432/agqahBnx1Hx6gYrranCTBa1HDf1MWQWUJW3G0N gByNa4NrUWJe8t/dx/XTWQXsg/i95D2xvj7NuPsaJnsfp3ZWIBELjRwguLNsI24tDdwI Zg5zIPi+xcQ72c937B2Zjfs4UySyaJSqRlTTlJgQe98GyQA4e7HCgOft6L3DIwbFUjNQ 0maahYqDLDnU+pLVACrgY7NV41F+BMEvYRtc7oYHJgosVJA2fX9UlqvrKE1++/jLURCR 9ZnQ== X-Gm-Message-State: AOJu0YyCVxjJew8KFXEsfikLYRlNYm0kBzVMM3lacDLBZ5Bydh0R7Lu9 INt2Wsgyy0k/aTHqNEk7RsllZ3cUXpCcpfLPx3Svr/1kQQZv2J7MfuHusg== X-Gm-Gg: ASbGncuIBBXadYNXxtaU1cOU4e+NXvYMjgJGglcOq/MIqG0XRlgdy2hnZpKSssOXn66 l17z2KVGeMQN+ZeNWdb/MVmeQhw8n0hd3/JnKY+qzcGJk4AQDexrklEzMN8SiCo0WSFPWjerqVh J9bJ5qHFtvrM+nm5CoqjiA7Md/gDHzaWQdZo312OCgb/X7RdwK5GsHNUPlz/V9SINWmSO2qWGdo Jva+Jg9ATqf+gynpWH2kxaupLD1RlbSmm5B2WcJceqdJfBAmhDnzG+/cWU9KoBAe6h2P6nMxZ7P gNQReHptZ1yWKH+hkjpybSvu8etERvJkxHpVKAWnnoC57bhJskr/Mh7oUhln X-Google-Smtp-Source: AGHT+IEt9fReQ/QLPKKTVvwenNAppJ/HgYh17GbBDvgTHee69DhBJkrkOvXsBlfv3L4Nwp1hXrR7Ew== X-Received: by 2002:a05:6a00:2c86:b0:740:6630:633f with SMTP id d2e1a72fcca58-7409cefc1c9mr9974399b3a.8.1746686166348; Wed, 07 May 2025 23:36:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:36:05 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:23 +0900 Message-ID: <1cfd997e47da00b0647f46599bdbf7d7fb920af6.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 This factorizes out the remaining bashrc bits from /etc/skel/.bashrc to a the template used for both /etc/bashrc on Guix System and ~/.bashrc for home-bash-service-type. Rationale: The use of /etc/skel introduce state: the file is only copied originally when the user account is created, and never (automatically) refreshed again. * gnu/system.scm (operating-system-etc-service): : Guard against souring /etc/bashrc in non-interactive, SSH case. : Use %default-bashrc, having migrated the remaining definitions to... * gnu/system/shadow.scm (%default-bashrc): ... here. Factorize aliases to... * gnu/services.scm (%default-bash-aliases): ... here. (%default-bashrc-d-aliases): New variable. (%default-etc-bashrc-d-files): Include it in the default configuration. * gnu/services/base.scm (%base-services): Register etc-bashrc-d-service-type. * gnu/home/services/shells.scm (add-bash-configuration): Do not set PS1, now part of %default-bashrc. (home-bash-configuration) [guix-defaults?]: Update doc. [aliases]: Set %default-bash-aliases as the default value. Update doc. * doc/guix.texi (Shells Home Services): Update documentation. (Service Reference): Update example. Change-Id: I340c614983a78fd20a9c4a9705e7fc542ae9b513 --- doc/guix.texi | 19 +++++++++++-------- gnu/home/services/shells.scm | 14 +++++++------- gnu/services.scm | 23 +++++++++++++++++++++-- gnu/services/base.scm | 5 ++++- gnu/system.scm | 24 +++++++----------------- gnu/system/shadow.scm | 18 ++++++++++-------- gnu/tests/base.scm | 17 ++++++++++------- 7 files changed, 70 insertions(+), 50 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index c8d74a3c31b..3c80ed24679 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47543,15 +47543,15 @@ Service Reference @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: +@file{etc/bashrc.d/*.sh} prefixed files added. Since the service is +part @code{%base-services}, it can be extended via @code{simple-service} +like so: @example (use-package-modules gnome) ;for the `vte' package -(service etc-bashrc-d-service-type - (append (list (file-append vte "/etc/profile.d/vte.sh")) - %default-etc-bashrc-d-files)) +(simple-service 'vte-integration etc-bashrc-d-service-type + (list (file-append vte "/etc/profile.d/vte.sh"))) @end example @end defvar @@ -49177,8 +49177,11 @@ Shells Home Services The Bash package to use. @item @code{guix-defaults?} (default: @code{#t}) (type: boolean) -Add sane defaults like reading @file{/etc/bashrc} and coloring the output of -@command{ls} to the top of the @file{.bashrc} file. +Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring +@file{/etc/profile} is sourced for non-interactive SSH shells. If you +use Guix System, is it safe to set this to @code{#f}, as in this case +this is already taken care of by the globally installed +@file{/etc/bashrc}. @item @code{environment-variables} (default: @code{'()}) (type: alist) Association list of environment variables to set for the Bash session. The @@ -49186,7 +49189,7 @@ Shells Home Services here (@pxref{Essential Home Services}). The contents of this field will be added after the contents of the @code{bash-profile} field. -@item @code{aliases} (default: @code{'()}) (type: alist) +@item @code{aliases} (default: @code{%default-bash-aliases}) (type: alist) 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, diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index bab5730c3d6..969a3eb8dcf 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -20,6 +20,7 @@ (define-module (gnu home services shells) #:use-module (gnu services configuration) + #:use-module ((gnu services) #:select (%default-bash-aliases)) #:autoload (gnu system shadow) (%default-bashrc %default-zprofile) #:use-module (gnu home services utils) #:use-module (gnu home services) @@ -333,9 +334,12 @@ (define-configuration home-bash-configuration (package bash) "The Bash package to use.") (guix-defaults? + ;; TODO: Set to #f when the target system is determined to be Guix System. (boolean #t) - "Add sane defaults like reading @file{/etc/bashrc} and coloring the output of -@command{ls} to the top of the @file{.bashrc} file.") + "Add sane defaults like setting @env{PS1}, @env{SHELL}, and ensuring +@file{/etc/profile} is sourced for non-interactive SSH shells. If you use +Guix System, is it safe to set this to @code{#f}, as in this case this is +already taken care of by the globally installed @file{/etc/bashrc}.") (environment-variables (alist '()) "Association list of environment variables to set for the Bash session. The @@ -344,7 +348,7 @@ (define-configuration home-bash-configuration added after the contents of the @code{bash-profile} field." (serializer serialize-posix-env-vars)) (aliases - (alist '()) + (alist %default-bash-aliases) "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 @@ -423,10 +427,6 @@ (define (add-bash-configuration config) 'bashrc (if (home-bash-configuration-guix-defaults? config) (list (plain-file-content %default-bashrc) "\n" - ;; The host distro might provide a bad 'PS1' - ;; default--e.g., not taking $GUIX_ENVIRONMENT into - ;; account. Provide a good default here when asked. - "PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '\n" (serialize-field 'aliases)) (list (serialize-field 'aliases)))) (file-if-not-empty 'bash-logout))))) diff --git a/gnu/services.scm b/gnu/services.scm index 5dbda176b80..159d357c3e7 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -125,6 +125,7 @@ (define-module (gnu services) etc-profile-d-service-type etc-bashrc-d-service-type %default-etc-bashrc-d-files + %default-bash-aliases etc-directory privileged-program-service-type setuid-program-service-type ; deprecated @@ -993,9 +994,27 @@ (define etc-profile-d-service-type (define files->bashrc-d-directory (make-files->etc-directory "bashrc.d")) +;;; Use an alist to be compatible with . +(define %default-bash-aliases + '(("ls" . "ls -p --color=auto") + ("ll" . "ls -l") + ("grep" . "grep --color=auto") + ("ip" . "ip -color=auto"))) + +;;; ... but avoid the full blown bash-serialize-aliases, which depends on +;;; other 'guix home' definitions such as `shell-double-quote'. +(define %default-bashrc-d-aliases + (plain-file "aliases.sh" + (string-join + (map (match-lambda + ((alias . value) + (format #f "~a=~s~%" alias value))) + %default-bash-aliases) + ""))) + (define %default-etc-bashrc-d-files - (list (file-append bash-completion - "/etc/profile.d/bash_completion.sh"))) + (list (file-append bash-completion "/etc/profile.d/bash_completion.sh") + %default-bashrc-d-aliases)) (define etc-bashrc-d-service-type (service-type diff --git a/gnu/services/base.scm b/gnu/services/base.scm index dfb96b1f0cc..adf456dc99e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -4135,7 +4135,10 @@ (define %base-services (service mingetty-service-type (mingetty-configuration (tty "tty5"))) (service mingetty-service-type (mingetty-configuration - (tty "tty6"))) + (tty "tty6"))) + + ;; Extra Bash configuration including Bash completion and aliases. + (service etc-bashrc-d-service-type) (service static-networking-service-type (list %loopback-static-networking)) diff --git a/gnu/system.scm b/gnu/system.scm index d009a2036b0..ad37912f809 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1132,23 +1132,13 @@ (define* (operating-system-etc-service os) done unset i -if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ] -then - # Load Bash-specific initialization code. - . /etc/bashrc +if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]; then + # Load Bash-specific initialization code, taking care to not source + # /etc/bashrc when invoked from a non-interactive SSH shell, + # to avoid recursion (/etc/bashrc also sources /etc/profile + # in the non-login, non-interactive SSH case). + [[ $- != *i* && -n $SSH_CLIENT ]] || source /etc/bashrc fi -")) - - (bashrc (plain-file "bashrc" "\ -# Bash-specific initialization. - -# Provide a default prompt. The user's ~/.bashrc can override it. -PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ ' - -for i in /etc/bashrc.d/*.sh; do - [[ -r $i ]] && source \"$i\" -done -unset i "))) (service etc-service-type `(("os-release" ,os-release) @@ -1159,7 +1149,7 @@ (define* (operating-system-etc-service os) ("issue" ,issue) ,@(if nsswitch `(("nsswitch.conf" ,nsswitch)) '()) ("profile" ,profile) - ("bashrc" ,bashrc) + ("bashrc" ,%default-bashrc) ;; Write the operating-system-host-name to /etc/hostname to prevent ;; NetworkManager from changing the system's hostname when connecting ;; to certain networks. Some discussion at diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 50ac102707e..03af193f36f 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -146,8 +146,11 @@ (define %base-user-accounts (define %default-bashrc (plain-file "bashrc" "\ -# Bash initialization for interactive non-login shells and -# for remote shells (info \"(bash) Bash Startup Files\"). +# Bash-specific initialization, including for non-login and remote +# shells (info \"(bash) Bash Startup Files\"). + +# Provide a default prompt. +PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ ' # Export 'SHELL' to child processes. Programs such as 'screen' # honor it and otherwise use /bin/sh. @@ -164,10 +167,11 @@ (define %default-bashrc return fi -alias ls='ls -p --color=auto' -alias ll='ls -l' -alias grep='grep --color=auto' -alias ip='ip -color=auto'\n")) +for i in /etc/bashrc.d/*.sh; do + [[ -r $i ]] && source \"$i\" +done +unset i +")) (define %default-bash-profile (plain-file "bash_profile" "\ @@ -288,12 +292,10 @@ (define (default-skeletons) 'useradd' in the home directory of newly created user accounts." (let ((profile %default-bash-profile) - (bashrc %default-bashrc) (zprofile %default-zprofile) (xdefaults %default-xdefaults) (gdbinit %default-gdbinit)) `((".bash_profile" ,profile) - (".bashrc" ,bashrc) ;; Zsh sources ~/.zprofile before ~/.zshrc, and it sources ~/.zlogin ;; after ~/.zshrc. To avoid interfering with any customizations a user ;; may have made in their ~/.zshrc, put this in .zprofile, not .zlogin. diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index edb7e9112ba..85e5b954b90 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -187,6 +187,8 @@ (define* (run-basic-test os command #:optional (name "basic") "\ . /etc/bashrc set -e -x +test -f /etc/bashrc.d/bash_completion.sh +test -f /etc/bashrc.d/aliases.sh test -f /etc/bashrc.d/test_bashrc_d.sh test \"$BASHRC_D_OK\" = yes")) marionette))) @@ -593,14 +595,15 @@ (define* (test-basic-os #:optional (kernel linux-libre)) (plain-file "invalid-name" "not a POSIX script -- ignore me"))) - (service + (simple-service + 'extra-bashrc-d-files etc-bashrc-d-service-type - (list (plain-file - "test_bashrc_d.sh" - "export BASHRC_D_OK=yes\n") - (plain-file - "invalid-name" - "not a Bash script -- ignore me"))) + (list (plain-file + "test_bashrc_d.sh" + "export BASHRC_D_OK=yes\n") + (plain-file + "invalid-name" + "not a Bash script -- ignore me"))) %base-services))) #:imported-modules '((gnu services herd) (guix combinators)))) From patchwork Thu May 8 06:02:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42401 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 C66BF27BC4B; Thu, 8 May 2025 07:37:57 +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=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 4137327BC49 for ; Thu, 8 May 2025 07:37:57 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCuss-0006e0-Uh; 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-0006ao-89 for guix-patches@gnu.org; Thu, 08 May 2025 02:37:15 -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 1uCusT-0001in-VU; 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=ozWAMZjEB0+EurLbIq1ifoXSP96oYM+YD19g3LSwD5s=; b=f84R6zaCeRIe91Uhgw7OApYOz+SDzlXWZ+01dy9vjmaueBsXdW2cMssJIXqZJZeteqkeHs6sMwOIx3LYGVqtanS1HFFAceQk3oPR+q6sa1sNY9AfxD3kH4ZARrzbFa8SVpAGsaWJZuwt6LZVEHydTf1/pE2gtfhXuFU1OPmt6vQkYnO2xxADhEyJV1gre3bvVUyz0SoXEl4LmzKB+L1N6fJnT9hGAclP8/FO2h++VfQy+wwAqr6MWRjvvmKcAE/dO5igS9cMsljaJADecTFGVh2su34WQiw4nEHu9wjbMtu1YJ66O4TPrquMtP+S03KW2Cf/XAn3qzsAAvLlhZLTRg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusS-0000mL-OM; Thu, 08 May 2025 02:37:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 8/9] services: Add vte-integration-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: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 , 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.17466861812828 (code B ref 78308); Thu, 08 May 2025 06:37:04 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:21 +0000 Received: from localhost ([127.0.0.1]:52882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurk-0000jX-FX for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:20 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:47263) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCure-0000i0-QJ for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:15 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-739be717eddso563603b3a.2 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686168; x=1747290968; 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=ozWAMZjEB0+EurLbIq1ifoXSP96oYM+YD19g3LSwD5s=; b=J521l/IJhHe8iDEcbFjw6KhyQ9J7e/jdoCXEX0VGZhxZGQ6ALRMEw1KMFVkiZYAJE1 KZLlLfPxuo9RR/oYIC0ZkApmhYi+r1GekYZrdiX1z9xLH6rHdQtgwuyCwDrdMhKQA+1O zottyFpobYgbSKuSPpnWVmeQvIYxmSEaP/pfBZRqHUjTCoCpA3pi8VIBDHUj9PYQFWvy umlG8yPmAEZ5qPzrToGi+GNaM4Hr+9UDtB1RVjIJhcbZBMxeib8X+IgwD+NtoM7097Fb Nti273JKyKmMtrkrYS7swKagvAQwo555euGlCaJL3wBqY9k74Icw2qvD6xI8gFCbFzU4 zSjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686168; x=1747290968; 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=ozWAMZjEB0+EurLbIq1ifoXSP96oYM+YD19g3LSwD5s=; b=X5NnyTS3eayGO2KvenwCYftGxA3LKLWxD8HMV3kmrwUby+iZHqLCgfxWUxhf7wSE1m C01EYhOlq5tehckC6lvcr8VtGTNFFzFF5RVXXBTRAbeuMyJ/pmmzbBalKDcalh7+F1qr jrKGEP+WybfY5KuAKKVdnQanxh3WOx9nIXmmWByqwFpa1y/nuHxvG9Z5UzaL9NqlKldS PMJVNNQGH4U8XK91MFgu5vSNhz97/NIOZCTaXr4NIBGamlqwAMjAkjtHB/nYV3kntOhB r9yQhkoPjtv1ahSQhe2KpVEz34t5E7P+r4lfQHkTEVP//Uej1R/m26kbsmrGoX1nApuZ 54YA== X-Gm-Message-State: AOJu0YzFkDHJRGd0oMSaib3twioUU9sRcq3ThGyjz8trNo2DXTb3asZX S0oeDwHtp40s/ObA0QYI4VGmv4jeHFSyNcjuZkHeLrODtEbhyHQ76oeSvQ== X-Gm-Gg: ASbGncvReo83J0L3QGgCRPP66x+3V5/3wzPWtKJ6pN01Y0zlIv2iguweBAzzkgTR0Mv ruwlnT9RR470ua93y4fMvPmvX7LAoKk7j9LD2nEe8MyrmQ77/EtIm79FPd+RRWZi4nQWILxxLmP jOgWWvLroMshkfkCf1ch2yKO/w51jmEkzhNwzs/+PYJVkYFrDHghNtKaXxzaecDynS7WM7OFzMY J0ncRH0RRUJOZZE3sh0ZGfj4YU5HqMsWkwzPBkfCWJZFc0gK44ebC/b5Q8cbi/ZupALsJIsQ1mn LIkvhm+9lO7CAa3ql73r/5FYHjH3M/BsmGPIk2sBtT7XmX6FGsUGwbbgXRQD X-Google-Smtp-Source: AGHT+IE3Mvb74NKCXQRkn+FoBLtW+wZOE2aIS/xtEGNRRUxtUK729ojebCEeU5JA4suIR8V53IYAEQ== X-Received: by 2002:a05:6a00:ad8f:b0:739:4a30:b900 with SMTP id d2e1a72fcca58-7409cef9989mr7874463b3a.7.1746686168311; Wed, 07 May 2025 23:36:08 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:36:07 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:24 +0900 Message-ID: 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/services.scm (vte-integration-service-type): New service type. * doc/guix.texi (Service Reference): Document it. Change-Id: I7e4bc1b913b50a5a061894f9ddef27f1877b62a2 --- doc/guix.texi | 15 +++++++++++++++ gnu/services.scm | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 3c80ed24679..1eafd4eaa0e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47555,6 +47555,21 @@ Service Reference @end example @end defvar +@defvar vte-integration-service-type +This services adds the @file{/etc/bashrc.d/vte.sh} to your system, which +improves the Bash and Zsh experience when using VTE-powered terminal +emulators. This causes for example the current directory to be +displayed in the terminal emulator's tab title, and the current +directory to be preserved when creating a new tab, among other features. +The value of the service is the @code{vte} package to use. + +@example +(use-package-modules gnome) ;for the `vte' package + +(service vte-integration-service-type vte) +@end example +@end defvar + @defvar privileged-program-service-type Type for the ``privileged-program service''. This service collects lists of executable file names, passed as gexps, and adds them to the set of diff --git a/gnu/services.scm b/gnu/services.scm index 159d357c3e7..ce15a39d063 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -47,6 +47,7 @@ (define-module (gnu services) #:use-module (guix deprecation) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages gnome) #:use-module (gnu packages hurd) #:use-module (gnu packages linux) #:use-module (gnu system privilege) @@ -138,6 +139,7 @@ (define-module (gnu services) linux-builder-configuration-kernel linux-builder-configuration-modules linux-loadable-module-service-type + vte-integration-service-type %boot-service %activation-service @@ -1027,6 +1029,19 @@ (define etc-bashrc-d-service-type Bash shells.") (default-value %default-etc-bashrc-d-files))) +(define vte-integration-service-type + (service-type + (name 'vte-integration) + (extensions + (list (service-extension etc-bashrc-d-service-type + (lambda (vte) + (list (file-append + vte "/etc/profile.d/vte.sh")))))) + (default-value vte) ;the vte package to use + (description "A service for adding the @file{/etc/bashrc.d/vte.sh} script +to your system, which improves the Bash and Zsh experience when using +VTE-powered terminal emulators."))) + (define (privileged-program->activation-gexp programs) "Return an activation gexp for privileged-program from PROGRAMS." (let ((programs From patchwork Thu May 8 06:02:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42403 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 BB47827BC4B; Thu, 8 May 2025 07:38:06 +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=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 4F46627BC49 for ; Thu, 8 May 2025 07:38:06 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCust-0006e8-6f; Thu, 08 May 2025 02:37:31 -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-0006an-8A for guix-patches@gnu.org; Thu, 08 May 2025 02:37:15 -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 1uCusV-0001iq-7q for guix-patches@gnu.org; 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=9aCtet6tmN6TIlxwercHuM6/PCXa4VXP0TX71clwZv4=; b=gPRpDf8HUNz/66qVbSI7roqHvJZqPiPfCmJaBWNSIvdSqggR+E90CSO5X+HQhcaZ3QUqUJ2fLg9/lys4afWKykGyr8SCpK0EKKK/HIjy0TBi4Pjgikxhb/lIRNcoQk2EL/RMeIOxW7oveyCw58mTSVLoXdOdQUh3gTaz4TUYOa5H1EYv7OP0RdnEJJtvrfR26ptiH5+x8swDDN856ihxdqAvTrR2JS2G5mBFFooI/nbAp8rSYzzOPIRD1/PQvwStd4d6tZDMxQGVgOEt04RDuYytIjmHCxAq2zdXsqBJrjjsdHjKVF15kzf5QAzx75O07O6g05TYBt6jyJhxkNeH0g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uCusT-0000mc-Od; Thu, 08 May 2025 02:37:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78308] [PATCH 9/9] services: Add vte-integration-service-type to %desktop-services. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, noelopez@free.fr, vivien@planete-kraus.eu, guix-patches@gnu.org Resent-Date: Thu, 08 May 2025 06:37:05 +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 , Liliana Marie Prikler , Maxim Cournoyer , =?utf-8?q?No=C3=A9?= Lopez , Vivien Kraus X-Debbugs-Original-Xcc: Liliana Marie Prikler , Maxim Cournoyer , =?utf-8?q?No=C3=A9?= Lopez , Vivien Kraus Received: via spool by 78308-submit@debbugs.gnu.org id=B78308.17466861822842 (code B ref 78308); Thu, 08 May 2025 06:37:05 +0000 Received: (at 78308) by debbugs.gnu.org; 8 May 2025 06:36:22 +0000 Received: from localhost ([127.0.0.1]:52887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCurl-0000jh-SJ for submit@debbugs.gnu.org; Thu, 08 May 2025 02:36:22 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:42488) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCurg-0000iE-HC for 78308@debbugs.gnu.org; Thu, 08 May 2025 02:36:17 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7398d65476eso595404b3a.1 for <78308@debbugs.gnu.org>; Wed, 07 May 2025 23:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746686170; x=1747290970; 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=9aCtet6tmN6TIlxwercHuM6/PCXa4VXP0TX71clwZv4=; b=ILRSTxdRJrlHzKiwAJSg07Ii1zX4mE/mHG4SnoprJpQlIFk+yjoAKIuDIDHAVKwJqI z5n+FVAduwKd7VuTB9VtGgP1rKUSu2yOWn4Xn+JjIrLsOw/k+OF9VOxIhrbDeJSU8y4m NtxBYcjnmw9CjNHpgbHqLQ6rJWvr9q5j1DoVwiBoX6IRFWxv+9MrrnTlQ+NrClPJFi+L l1V/29C7jMmLIG8u9+T4yNtK6gEMn5OONSnJdWacyiTYgG/nvHBspn0krTbPDEn3P54h GECm8UqQwTHu2uJROgcuqVM4nETJ8TeXjkORgRNCwlrYXKE5BOOm2PKv+PlEPF9WxGn7 7ESQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746686170; x=1747290970; 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=9aCtet6tmN6TIlxwercHuM6/PCXa4VXP0TX71clwZv4=; b=Ue3da6n+TKWKgVxP9QHE1GvKhHl1eKTmbUvUsGfpe7GwWK04XcJoVGFW217kR0SYZv 17/Js2QOWVaEd0Ec5Pls0ULAuolMbvPJ3PvI1/HQG5JUDyVclHfOu9zz9Nq1Jh3mB+7f o0LIeApD7lh7y60X72TLx62JasqUFQ/5UZ5P13u+3FwjXaNb3hpngeld6mGsiMGT0GyT hV8UgEqZRBazEyaelpSx6l3TlyjWyTthM4qhjbIJEQJG4d+Gs7ZmJN0IREZerY0dLDNj 1rpwqRRh6UIBgrxtZVUa9zrAt/BzwBUa6NRK2zSzxp8ZfKEUSHuUKeuAD9XexKkFz1Vj jrNQ== X-Gm-Message-State: AOJu0Yx46j1sAAiJMjL2NGdL9iPhnbyXqQPtbTwt8TEIzypmEjPq/J6K EjgL+l70XKl2RdjAh6CsFjkvSXWU9ew239CKLDT4Yxz/lPC2U4otzC8PfQ== X-Gm-Gg: ASbGncvKxvBE0ixGaMwLHjBZyJD0GFSkc8bwbgQe5ZDK6Rh+TC1jl8KN9YJVfvD9cjc bVcCcZ47IQ3y3smJpha9B6pTGVphX0bNMrB9hJpgsvXcK1sx2QnQZZhX1YvBaV5vM2mrxISw8ck jOsn2438K6dCs/6iMt1Q5LXHwDCuedcPN+s/DCius/7UOwZkvgeioMep4eiSQ0V8yzowBl+K2+O 6ldLp3xyaXXtvJ+MIH421iyl1mS9lvPhMEnCvWyELKHyGGbHlg+khiNjfGW7avAkAjcfApjA3yS KsQj2qSvN8yTXB8qLagKR9aihCTA5KJp/deCqWefjvFDlhlb3YDrF/KHL8s3 X-Google-Smtp-Source: AGHT+IHh/0xoHFpE/7ciSeVDhdrNXJFcHfpbMLOCkbs5kxe9Vhp/bqcWqtp5tg5vlIUYOBedi0ZyDw== X-Received: by 2002:a05:6a00:ace:b0:736:b400:b58f with SMTP id d2e1a72fcca58-740a91d0efdmr4287778b3a.0.1746686170159; Wed, 07 May 2025 23:36:10 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 23:36:09 -0700 (PDT) From: Maxim Cournoyer Date: Thu, 8 May 2025 15:02:25 +0900 Message-ID: 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/services/desktop.scm (desktop-services-for-system): Fixes: Change-Id: Ib29468468e327801a4e95361610159de61f7e8d6 --- gnu/services/desktop.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 2127c2d389c..ffa02063514 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -2458,6 +2458,10 @@ (define* (desktop-services-for-system #:optional ;; to avoid GDM stale cache and permission issues. gdm-file-system-service + ;; Provides a nicer terminal emulator experience for VTE-using + ;; terminal emulators such as GNOME Console, Xfce Terminal, etc. + (service vte-integration-service-type) + ;; The global fontconfig cache directory can sometimes contain ;; stale entries, possibly referencing fonts that have been GC'd, ;; so mount it read-only.