me
/
guix
Archived
1
0
Fork 0

gnu: fish: Use fish-foreign-env to source /etc/profile.

* gnu/packages/shells.scm (fish): Use fish-foreign-env to source /etc/profile
  when user logs in.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Meiyo Peng 2019-01-20 21:42:15 +08:00 committed by Ludovic Courtès
parent 1d962fc0a1
commit 4bddd12ad5
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 21 additions and 1 deletions

View File

@ -102,7 +102,8 @@ direct descendant of NetBSD's Almquist Shell (@command{ash}).")
(base32 "1kzjd0n0sfslkd36lzrvvvgy3qwkd9y466bkrqlnhd5h9dhx77ga")))) (base32 "1kzjd0n0sfslkd36lzrvvvgy3qwkd9y466bkrqlnhd5h9dhx77ga"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs (inputs
`(("groff" ,groff) ; for 'fish --help' `(("fish-foreign-env" ,fish-foreign-env)
("groff" ,groff) ; for 'fish --help'
("ncurses" ,ncurses) ("ncurses" ,ncurses)
("pcre2" ,pcre2) ; don't use the bundled PCRE2 ("pcre2" ,pcre2) ; don't use the bundled PCRE2
("python" ,python))) ; for fish_config and manpage completions ("python" ,python))) ; for fish_config and manpage completions
@ -170,6 +171,25 @@ direct descendant of NetBSD's Almquist Shell (@command{ash}).")
" $__extra_confdir\n") " $__extra_confdir\n")
port) port)
(close-port 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))))) #t)))))
(synopsis "The friendly interactive shell") (synopsis "The friendly interactive shell")
(description (description