aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ottaway <jamesottaway@users.noreply.github.com>2020-08-15 06:36:23 +1000
committerGitHub <noreply@github.com>2020-08-14 22:36:23 +0200
commit9a473b693ac6dd3249d2ff0d130c7decfca8ed96 (patch)
treede4afdcd4141229da02ba7d02e3f6bf3d7c386d0
parentf4f9f1a618eb7c19b765b02c235e13657b5aa150 (diff)
zsh: add `cdpath` option (#1418)
-rw-r--r--modules/programs/zsh.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix
index 5199e51e972..ed65d5fe487 100644
--- a/modules/programs/zsh.nix
+++ b/modules/programs/zsh.nix
@@ -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