gnu: home: zsh: Load environment when running via ssh
* 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. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
		
							parent
							
								
									c69dc48da6
								
							
						
					
					
						commit
						d2a751c14e
					
				
					 1 changed files with 3 additions and 4 deletions
				
			
		| 
						 | 
					@ -183,7 +183,8 @@ another process for example)."))
 | 
				
			||||||
  (mixed-text-file
 | 
					  (mixed-text-file
 | 
				
			||||||
   "zshenv"
 | 
					   "zshenv"
 | 
				
			||||||
   (zsh-serialize-field config '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)
 | 
					(define (zsh-file-zprofile config)
 | 
				
			||||||
  (mixed-text-file
 | 
					  (mixed-text-file
 | 
				
			||||||
| 
						 | 
					@ -209,9 +210,7 @@ source ~/.profile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define (zsh-get-configuration-files config)
 | 
					(define (zsh-get-configuration-files config)
 | 
				
			||||||
  `((".zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
 | 
					  `((".zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
 | 
				
			||||||
    ,@(if (or (zsh-field-not-empty? config 'zshenv)
 | 
					    (".zshenv" ,(zsh-file-by-field config 'zshenv)) ;; Always non-empty
 | 
				
			||||||
              (zsh-field-not-empty? config 'environment-variables))
 | 
					 | 
				
			||||||
          `((".zshenv" ,(zsh-file-by-field config 'zshenv))) '())
 | 
					 | 
				
			||||||
    ,@(if (zsh-field-not-empty? config 'zshrc)
 | 
					    ,@(if (zsh-field-not-empty? config 'zshrc)
 | 
				
			||||||
          `((".zshrc" ,(zsh-file-by-field config 'zshrc))) '())
 | 
					          `((".zshrc" ,(zsh-file-by-field config 'zshrc))) '())
 | 
				
			||||||
    ,@(if (zsh-field-not-empty? config 'zlogin)
 | 
					    ,@(if (zsh-field-not-empty? config 'zlogin)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue