1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 08:28:30 +02:00

zsh: add cdpath option (#1418)

This commit is contained in:
James Ottaway 2020-08-15 06:36:23 +10:00 committed by GitHub
parent f4f9f1a618
commit 9a473b693a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,6 +185,14 @@ in
type = types.nullOr types.bool;
};
cdpath = mkOption {
default = [];
description = ''
List of paths to autocomplete calls to `cd`.
'';
type = types.listOf types.str;
};
dotDir = mkOption {
default = null;
example = ".config/zsh";
@ -392,6 +400,10 @@ in
home.file."${relToDotDir ".zshrc"}".text = ''
typeset -U path cdpath fpath manpath
${optionalString (cfg.cdpath != []) ''
cdpath+=(${concatStringsSep " " cfg.cdpath})
''}
for profile in ''${(z)NIX_PROFILES}; do
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
done