generic-linux: add system fpaths for zsh

PR #2013
This commit is contained in:
Colin Summers 2021-05-16 16:59:10 -07:00 committed by Robert Helgesson
parent 0dab813748
commit 275f39611d
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
1 changed files with 18 additions and 0 deletions

View File

@ -57,6 +57,24 @@ in {
. "${profileDirectory}/etc/profile.d/hm-session-vars.sh"
'';
programs.zsh.envExtra = ''
# Make system functions available to zsh
() {
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
local system_fpaths=(
# Package default
/usr/share/zsh/site-functions(/-N)
# Debian
/usr/share/zsh/functions/**/*(/-N)
/usr/share/zsh/vendor-completions/(/-N)
/usr/share/zsh/vendor-functions/(/-N)
)
fpath=(''${fpath} ''${system_fpaths})
}
'';
systemd.user.sessionVariables = let
# https://github.com/archlinux/svntogit-packages/blob/packages/ncurses/trunk/PKGBUILD
# https://salsa.debian.org/debian/ncurses/-/blob/master/debian/rules