From 275f39611dc32243842d5818141278b5676653f2 Mon Sep 17 00:00:00 2001 From: Colin Summers Date: Sun, 16 May 2021 16:59:10 -0700 Subject: [PATCH] generic-linux: add system fpaths for zsh PR #2013 --- modules/targets/generic-linux.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/targets/generic-linux.nix b/modules/targets/generic-linux.nix index b7680885..9132d889 100644 --- a/modules/targets/generic-linux.nix +++ b/modules/targets/generic-linux.nix @@ -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