diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index d6e15e622..1b7ccf7a6 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -12,6 +12,7 @@ let relToDotDir "plugins" else ".zsh/plugins"; envVarsStr = config.lib.zsh.exportAll cfg.sessionVariables; + localVarsStr = config.lib.zsh.defineAll cfg.localVariables; aliasesStr = concatStringsSep "\n" ( mapAttrsToList (k: v: "alias ${k}='${v}'") cfg.shellAliases @@ -265,6 +266,15 @@ in default = {}; description = "Options to configure oh-my-zsh."; }; + + localVariables = mkOption { + type = types.attrs; + default = {}; + example = { POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=["dir" "vcs"]; }; + description = '' + Extra local variables defined at the top of .zshrc. + ''; + }; }; }; @@ -321,6 +331,8 @@ in ${getAttr cfg.defaultKeymap bindkeyCommands} ''} + ${localVarsStr} + ${concatStrings (map (plugin: '' path+="$HOME/${pluginsDir}/${plugin.name}" fpath+="$HOME/${pluginsDir}/${plugin.name}"