all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Saku Laesvuori via Guix-patches via <guix-patches@gnu.org>
To: 64765@debbugs.gnu.org
Cc: "Saku Laesvuori" <saku@laesvuori.fi>
Subject: [bug#64765] [PATCH v2] gnu: home: zsh: Load environment when running via ssh
Date: Thu, 17 Aug 2023 10:38:48 +0300	[thread overview]
Message-ID: <d54948f15db64b0cc3a9e36d649f0c71f71c49e1.1692257928.git.saku@laesvuori.fi> (raw)
In-Reply-To: <20230721105801.10840-1-saku@laesvuori.fi>

* 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(-)

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)

base-commit: ad4520b92662e42d7d0b1e648b2068300dbb95c8
-- 
2.41.0





  parent reply	other threads:[~2023-08-17  7:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 10:51 [bug#64765] [PATCH] gnu: home: zsh: Also load enviroment in non-login shells Saku Laesvuori via Guix-patches via
2023-07-21 12:42 ` 宋文武 via Guix-patches via
2023-07-21 14:44   ` Saku Laesvuori via Guix-patches via
2023-08-16 20:48     ` Ludovic Courtès
2023-08-17  7:36       ` Saku Laesvuori via Guix-patches via
2023-08-17  7:38 ` Saku Laesvuori via Guix-patches via [this message]
2023-09-17 13:10   ` bug#64765: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d54948f15db64b0cc3a9e36d649f0c71f71c49e1.1692257928.git.saku@laesvuori.fi \
    --to=guix-patches@gnu.org \
    --cc=64765@debbugs.gnu.org \
    --cc=saku@laesvuori.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.