From 4bddd12ad540d45a33a5f9f129b896843dca603f Mon Sep 17 00:00:00 2001 From: Meiyo Peng Date: Sun, 20 Jan 2019 21:42:15 +0800 Subject: [PATCH] gnu: fish: Use fish-foreign-env to source /etc/profile. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/shells.scm (fish): Use fish-foreign-env to source /etc/profile when user logs in. Signed-off-by: Ludovic Courtès --- gnu/packages/shells.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index 8e2ca2a9a3..d0561559e9 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -102,7 +102,8 @@ (define-public fish (base32 "1kzjd0n0sfslkd36lzrvvvgy3qwkd9y466bkrqlnhd5h9dhx77ga")))) (build-system gnu-build-system) (inputs - `(("groff" ,groff) ; for 'fish --help' + `(("fish-foreign-env" ,fish-foreign-env) + ("groff" ,groff) ; for 'fish --help' ("ncurses" ,ncurses) ("pcre2" ,pcre2) ; don't use the bundled PCRE2 ("python" ,python))) ; for fish_config and manpage completions @@ -170,6 +171,25 @@ (define-public fish " $__extra_confdir\n") port) (close-port port)) + #t)) + ;; Use fish-foreign-env to source /etc/profile. + (add-before 'install 'source-etc-profile + (lambda* (#:key inputs #:allow-other-keys) + (let ((port (open-file "share/__fish_build_paths.fish" "a"))) + (display + (string-append + "\n\n" + "# Patched by Guix.\n" + "# Use fish-foreign-env to source /etc/profile.\n" + "if status is-login\n" + " set fish_function_path " + (assoc-ref inputs "fish-foreign-env") "/share/fish/functions" + " $__fish_datadir/functions\n" + " fenv source /etc/profile\n" + " set -e fish_function_path\n" + "end\n") + port) + (close-port port)) #t))))) (synopsis "The friendly interactive shell") (description