From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qPoFLwZlumQ+CAAASxT56A (envelope-from ) for ; Fri, 21 Jul 2023 12:59:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qAFzLgZlumThdQAAauVa8A (envelope-from ) for ; Fri, 21 Jul 2023 12:59:18 +0200 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 D02175D315 for ; Fri, 21 Jul 2023 12:59:17 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=vDJK6iO3; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689937158; h=from:from:sender:sender:reply-to: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=WrdqVNeHcup1uq6LYLdc5JG3Bv7pml+vRte5OfKlvlI=; b=MVopSJmVnMV05gXcALLMV1anQ17u3/tTuBpPlugPbjzJsWsKvbAY9BosAKNnxvjGb/NhDO wqa7yVchvN1wvmJsJrQrjWDVfULESYxGYddi34MTdiyGio2qcaiQ7ue/PnB1mBQZxTw1Mu mb8PegNbfd+kb0Qi/pW8Lm9OqP/MbyHlVfQ5QvScPtiabiCbEH5a7mfcQxCD46Y6L4qm3r bJv927BW+b+2qgcajhY+fYWH0+A+sGkDXotjTP6VbB3am/kxpYQBU6HjSDUAAdTNvkynix 12uWnq1A6MeeoZB0636HtlTiCmUqF1qnisDd69QblOgDCSvyoElX8Wi9mkcjvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=vDJK6iO3; 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=1689937158; a=rsa-sha256; cv=none; b=VwN1sxa0lbH4j2cApFh5Qke4rfLOg6rz1hvIcgSkn/dfwBafKqtRpY5eKjtIXhk24+unsR f6Xpbj1NA0aGtjOqF/8e61q/IRiNnFcFp/iZHyvaW1ZcnGyJo9zdUMHYsNgi5jz7Mnng67 BWo62Gl2Mum3BKRC5hokMKEfMF8cwf9Xv3Th2YV+0eK6ZKSIjWuzXWjNu+4SfKP8qKSKss 7JOc4CqUFFoRWjE3z4JqEWd5yE8LknOwViLyqIRvPbIahg612I39oJyoYEvVc+QqIdkriw J4nHfF+JkFomLAF0uk93DNhkcDLSKjzC+ph3cZg3ZsjJyOzBWqYbgWJNwieo/g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMnqh-0002Xd-VY; Fri, 21 Jul 2023 06:59:03 -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 1qMnqg-0002XV-JD for guix-patches@gnu.org; Fri, 21 Jul 2023 06:59:02 -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 1qMnqg-0006I5-BA for guix-patches@gnu.org; Fri, 21 Jul 2023 06:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qMnqg-0002nD-6Z for guix-patches@gnu.org; Fri, 21 Jul 2023 06:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64765] [PATCH] gnu: home: zsh: Also load enviroment in non-login shells Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 21 Jul 2023 10:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64765 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64765@debbugs.gnu.org Cc: Saku Laesvuori X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168993710710680 (code B ref -1); Fri, 21 Jul 2023 10:59:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jul 2023 10:58:27 +0000 Received: from localhost ([127.0.0.1]:60678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMnq7-0002mA-9T for submit@debbugs.gnu.org; Fri, 21 Jul 2023 06:58:27 -0400 Received: from lists.gnu.org ([2001:470:142::17]:51782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMnq5-0002lw-2R for submit@debbugs.gnu.org; Fri, 21 Jul 2023 06:58:26 -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 1qMnpz-0002WA-BY for guix-patches@gnu.org; Fri, 21 Jul 2023 06:58:19 -0400 Received: from vmi571514.contaboserver.net ([75.119.130.101] helo=mail.laesvuori.fi) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMnpx-00066u-JH for guix-patches@gnu.org; Fri, 21 Jul 2023 06:58:19 -0400 Received: from X-kone.lan (88-113-24-127.elisa-laajakaista.fi [88.113.24.127]) by mail.laesvuori.fi (Postfix) with ESMTPSA id C051D34013B; Fri, 21 Jul 2023 12:58:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1689937095; bh=nmo0uFQ4QssPEfPBmTTi1R6HnrgOMJN2v81DvmBPdwg=; h=From:To:Cc:Subject:Date; b=vDJK6iO3MApKGq6DOtKSjRzwbgIz/byYYrlttE/Zm+r9MpWDxVztAPzz3XWowKzOI el4u3JI55ZySDWKYb0nKOc68fKKTZ6q7joqADJ2ELXRh3CGZ4u6Wq3Z1Au4t0ag2cS HamOAJkchZvWDMd/odubPKNZc63/3Ce2pMt4yt44= Date: Fri, 21 Jul 2023 13:51:19 +0300 Message-ID: <20230721105801.10840-1-saku@laesvuori.fi> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=75.119.130.101; envelope-from=saku@laesvuori.fi; helo=mail.laesvuori.fi X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Reply-to: Saku Laesvuori X-ACL-Warn: , Saku Laesvuori via Guix-patches From: Saku Laesvuori via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -4.65 X-Migadu-Queue-Id: D02175D315 X-Migadu-Spam-Score: -4.65 X-Migadu-Scanner: mx0.migadu.com X-TUID: 75rHuiss5SgM * gnu/home/services/shells.scm (zsh-file-zshenv): Add snippet to source profiles. (zsh-file-zprofile): Remove profile sourcing snippet. (zsh-get-configuration-files): Always add .zshenv as it is never empty. Check that .zprofile is not empty before adding it. --- The service incorrectly assumed that shells are either login shells or started from another shell. For example, ssh with a command argument starts shells that aren't login shells nor started from another shell. gnu/home/services/shells.scm | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index 7960590e7c..93a3b38267 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -182,21 +182,18 @@ (define* (zsh-field-not-empty? config field) (define (zsh-file-zshenv config) (mixed-text-file "zshenv" - (zsh-serialize-field config 'zshenv) - (zsh-serialize-field config 'environment-variables))) - -(define (zsh-file-zprofile config) - (mixed-text-file - "zprofile" "\ # Set up the system, user profile, and related variables. source /etc/profile # Set up the home environment profile. source ~/.profile - -# It's only necessary if zsh is a login shell, otherwise profiles will -# be already sourced by bash " + (zsh-serialize-field config 'zshenv) + (zsh-serialize-field config 'environment-variables))) + +(define (zsh-file-zprofile config) + (mixed-text-file + "zprofile" (zsh-serialize-field config 'zprofile))) (define (zsh-file-by-field config field) @@ -208,10 +205,9 @@ (define (zsh-file-by-field config field) (zsh-serialize-field config field))))) (define (zsh-get-configuration-files config) - `((".zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty - ,@(if (or (zsh-field-not-empty? config 'zshenv) - (zsh-field-not-empty? config 'environment-variables)) - `((".zshenv" ,(zsh-file-by-field config 'zshenv))) '()) + `((".zshenv" ,(zsh-file-by-field config 'zshenv)) ;; Always non-empty + ,@(if (zsh-field-not-empty? config 'zprofile) + `((".zprofile" ,(zsh-file-by-field config 'zprofile))) '()) ,@(if (zsh-field-not-empty? config 'zshrc) `((".zshrc" ,(zsh-file-by-field config 'zshrc))) '()) ,@(if (zsh-field-not-empty? config 'zlogin) base-commit: e401eff97706dc6cdaf20b01dd12e291d7d13c2b -- 2.41.0