From patchwork Thu Aug 17 07:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saku Laesvuori X-Patchwork-Id: 52953 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 2161827BBE9; Thu, 17 Aug 2023 08:40:22 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 319E727BBE2 for ; Thu, 17 Aug 2023 08:40:20 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWXbw-0002vy-I6; Thu, 17 Aug 2023 03:40:04 -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 1qWXbu-0002vn-Le for guix-patches@gnu.org; Thu, 17 Aug 2023 03:40: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 1qWXbu-0007ea-Bf for guix-patches@gnu.org; Thu, 17 Aug 2023 03:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWXbu-0005d5-7l for guix-patches@gnu.org; Thu, 17 Aug 2023 03:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64765] [PATCH v2] gnu: home: zsh: Load environment when running via ssh References: <20230721105801.10840-1-saku@laesvuori.fi> In-Reply-To: <20230721105801.10840-1-saku@laesvuori.fi> Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Thu, 17 Aug 2023 07:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64765 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64765@debbugs.gnu.org Cc: Saku Laesvuori , ( , Andrew Tropin , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 64765-submit@debbugs.gnu.org id=B64765.169225798321608 (code B ref 64765); Thu, 17 Aug 2023 07:40:02 +0000 Received: (at 64765) by debbugs.gnu.org; 17 Aug 2023 07:39:43 +0000 Received: from localhost ([127.0.0.1]:42702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWXba-0005cR-OQ for submit@debbugs.gnu.org; Thu, 17 Aug 2023 03:39:43 -0400 Received: from vmi571514.contaboserver.net ([75.119.130.101]:40044 helo=mail.laesvuori.fi) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWXbZ-0005cK-Gi for 64765@debbugs.gnu.org; Thu, 17 Aug 2023 03:39:41 -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 AD79F342466; Thu, 17 Aug 2023 09:39:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1692257995; bh=ayAoTjhIJJytP1n7vrTEwwP+FjwRxP4oUyNRWgpwhS0=; h=From:To:Cc:Subject:Date; b=U4Xgrd5B53P0j0kcGQRtmBph138RAerGE7ctj5JFg7f2fFQUyO6Kupx+XhgirBs1n FVNvlxQJFjFVHjVKqpor3yZGgy2rmXCHk3Ja5FFWxR2HXZj5Y9/Mqy/X/FlVY7DkEF xZWdhr6BO+3XUAjQCIuNykZ+pzKbsuhdBbqmFlrc= Date: Thu, 17 Aug 2023 10:38:48 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 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: , Reply-to: Saku Laesvuori X-ACL-Warn: , Saku Laesvuori via Guix-patches X-Patchwork-Original-From: Saku Laesvuori via Guix-patches via From: Saku Laesvuori 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/home/services/shells.scm (zsh-file-zshenv): Add snippet to source /etc/profile when running via ssh. (zsh-get-configuration-files): Always add .zshenv as it is never empty. --- gnu/home/services/shells.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) base-commit: ad4520b92662e42d7d0b1e648b2068300dbb95c8 diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index 7960590e7c..9dd56f634a 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -183,7 +183,8 @@ (define (zsh-file-zshenv config) (mixed-text-file "zshenv" (zsh-serialize-field config 'zshenv) - (zsh-serialize-field config 'environment-variables))) + (zsh-serialize-field config 'environment-variables) + "[ -n \"$SSH_CLIENT\" ] && source /etc/profile")) (define (zsh-file-zprofile config) (mixed-text-file @@ -209,9 +210,7 @@ (define (zsh-file-by-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 'zshrc) `((".zshrc" ,(zsh-file-by-field config 'zshrc))) '()) ,@(if (zsh-field-not-empty? config 'zlogin)