From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4LTbOT9jq2OLLQEAbAwnHQ (envelope-from ) for ; Tue, 27 Dec 2022 22:27:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ACmsOT9jq2PbbwAAauVa8A (envelope-from ) for ; Tue, 27 Dec 2022 22:27:27 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A0DEFBA23 for ; Tue, 27 Dec 2022 22:27:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAHTU-0001FT-Ik; Tue, 27 Dec 2022 16:27:04 -0500 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 1pAHTS-0001EL-OD for guix-patches@gnu.org; Tue, 27 Dec 2022 16:27:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAHTS-00040Z-Ff for guix-patches@gnu.org; Tue, 27 Dec 2022 16:27:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pAHTS-0007tF-B9 for guix-patches@gnu.org; Tue, 27 Dec 2022 16:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60365] [PATCH 2/4] system: Define default 'PS1' in /etc/bashrc rather than ~/.bashrc. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Dec 2022 21:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60365 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60365@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 60365-submit@debbugs.gnu.org id=B60365.167217639930280 (code B ref 60365); Tue, 27 Dec 2022 21:27:02 +0000 Received: (at 60365) by debbugs.gnu.org; 27 Dec 2022 21:26:39 +0000 Received: from localhost ([127.0.0.1]:56605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAHT4-0007sI-W2 for submit@debbugs.gnu.org; Tue, 27 Dec 2022 16:26:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAHSz-0007rd-Kg for 60365@debbugs.gnu.org; Tue, 27 Dec 2022 16:26:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAHSu-0003x5-EH; Tue, 27 Dec 2022 16:26:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=T9FJTiQCJAUcBzfAWXqDxlNDP/o4zwVmF0cpNlhwJ8Q=; b=QklAT+fXUPixWfOagNMN yIWGT4EeaC5KYTlmJ4ynJ31FQEhL/3xOKTtWg/j87BWMDCnX2bkl5aQPWRmuuHBcxXXk39CJvdDkz JTxevY5K9AQjf5p+fqyez1at2OGKzMeAo4GlIu8N/r7tyTuQgq969qpNkGwf0XIRnf5ACO+bhqcTA 23J8bc7hQNNbpwhl6WydDBl7Gaf4apJImW23RiXAnVLXUFAKLliaNrWcwjfiNqg1J2PCTcjfnZ8nV l6C+Ie/5XAWb+V01fTDxiQdP49oA/1XS1uDtsa5Hc2el6EL8uk7JgBvaMkNdq9gcEaNmrVswxip0n DW8fBqjqcmahAQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAHSt-0007DL-Pf; Tue, 27 Dec 2022 16:26:27 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 27 Dec 2022 22:26:16 +0100 Message-Id: <20221227212618.18063-2-ludo@gnu.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221227212618.18063-1-ludo@gnu.org> References: <20221227212618.18063-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672176447; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=T9FJTiQCJAUcBzfAWXqDxlNDP/o4zwVmF0cpNlhwJ8Q=; b=ABxXudXjk9whwIagNdGQBcByq0v9FGdSaadkVtsCuIgb6GhJuuu1wr1ByK69SxrYFMzGkz ESXij4H3rJo51BbnrS4Qir8UayFMxQebXsW4yRPy83szup49EKQv970VinLQg+9P/D5eNs 8Ebhg+QWx5ZVE+qf63KKq2INtPJqaqftzMMRTkU8ttVx+uDbpTOU2LKDnc1GlfyJCUSUs0 vAvXdbJHwC/2crsscBD0SFdzdvhADm0EilwG7BBMM+2PsZRaxXWC/9Ip98WI/iRJQcdU2f dPVf7invwchO0nY7fcqXoGzv5ilK8CIIZH9Y3VxxkclI/e/UnQiTFyB8D8byWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=QklAT+fX; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672176447; a=rsa-sha256; cv=none; b=pMbbJYiUIW71R2NeXdyvq4oRZzCFs7ZE4LeLEhgTwzRWQzGqmWRjVwS7VxJYT6Tf8HDVzb asT1t4+a9w6/oTRLdrDoXAY8TyjuWaaa5n1M8sxD1wSyFUJXZDXx5H/cIcD/Zk0cdTbOti rV97AsZLe/4hYuJ62bcQbdCTxJeemnWZPwkh/v2SZWDarzZQ/sQehrB+5/sZnUjuAeAdPu OXG+JrR9KVOH8xBzPdSexbZ851AgJMvD25jBl78/put+b3szQw+8EHxoc7eTgW2fLZlMoT aK6L5VulUKE1Jyd4WJ24fCt5UGNGeKNB+yrkuifZo1ImLsDsyGGPO8K2aEZehg== X-Spam-Score: -0.93 X-Migadu-Queue-Id: A0DEFBA23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=QklAT+fX; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.93 X-TUID: wlPZqQLI8G6j Users can override 'PS1' in ~/.bashrc if they wish. Previously, on Guix Home, the "default" 'PS1' would be set in ~/.bashrc when 'home-bash-configuration-guix-defaults?' is true, preventing users from overriding it via the 'environment-variables' field of 'home-bash-extension'. * gnu/system/shadow.scm (%default-bashrc): Remove 'PS1' setting. * gnu/system.scm (operating-system-etc-service): Define PS1 in /etc/bashrc. --- gnu/system.scm | 3 +++ gnu/system/shadow.scm | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 62c8e0c2b6..d67f9a615b 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1047,6 +1047,9 @@ (define* (operating-system-etc-service os) (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]}\\$ ' + # The 'bash-completion' package. if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ] then diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 4360a5ebd1..2e87928368 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -142,13 +142,6 @@ (define %default-bashrc # Source the system-wide file. [ -f /etc/bashrc ] && source /etc/bashrc -# Adjust the prompt depending on whether we're in 'guix environment'. -if [ -n \"$GUIX_ENVIRONMENT\" ] -then - PS1='\\u@\\h \\w [env]\\$ ' -else - PS1='\\u@\\h \\w\\$ ' -fi alias ls='ls -p --color=auto' alias ll='ls -l' alias grep='grep --color=auto'\n")) -- 2.38.1