diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2018-01-16 18:29:46 +0100 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2018-01-16 17:29:46 +0000 |
commit | b55d4c0564b0bde4cbc0c01b6ba7a1276382335a (patch) | |
tree | 2b6a21f08f3e1081370facf3f7df1d704ba95985 /nixos | |
parent | 13b4f440fc7accaf800345a81af548f8f89db08f (diff) |
programs.zsh.ohMyZsh: add `cacheDir` option (#33150)
The default cache directory set by oh-my-zsh is $ohMyZsh/cache which lives in the Nix store in our case. This causes issues with several completion plugins provided by oh-my-zsh.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/programs/zsh/oh-my-zsh.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nixos/modules/programs/zsh/oh-my-zsh.nix b/nixos/modules/programs/zsh/oh-my-zsh.nix index 9077643c4440c..b7834fa5f872c 100644 --- a/nixos/modules/programs/zsh/oh-my-zsh.nix +++ b/nixos/modules/programs/zsh/oh-my-zsh.nix @@ -48,6 +48,15 @@ in Name of the theme to be used by oh-my-zsh. ''; }; + + cacheDir = mkOption { + default = "$HOME/.cache/oh-my-zsh"; + type = types.str; + description = '' + Cache directory to be used by `oh-my-zsh`. + Default is /nix/store/<oh-my-zsh>/cache. + ''; + }; }; }; @@ -74,6 +83,13 @@ in "ZSH_THEME=\"${cfg.theme}\"" } + ${optionalString (cfg.cacheDir != null) '' + if [[ ! -d "${cfg.cacheDir}" ]]; then + mkdir -p "${cfg.cacheDir}" + fi + ZSH_CACHE_DIR=${cfg.cacheDir} + ''} + source $ZSH/oh-my-zsh.sh ''; }; |