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.
This commit is contained in:
parent
13b4f440fc
commit
b55d4c0564
|
@ -48,6 +48,15 @@ in
|
||||||
Name of the theme to be used by oh-my-zsh.
|
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}\""
|
"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
|
source $ZSH/oh-my-zsh.sh
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue