From d294aa4356f382f9905a0ae39f7c66b000acba89 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 16 Apr 2018 22:12:53 +0200 Subject: [PATCH] zsh: only source plugin file if it exists This allows adding plugins to fpath without sourcing anything --- modules/programs/zsh.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index d1371159f..c07e8a74c 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -320,7 +320,9 @@ in ''} ${concatStrings (map (plugin: '' - source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" + if [ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]; then + source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" + fi '') cfg.plugins)} # History options should be set in .zshrc and after oh-my-zsh sourcing.