fix: replace invalid 'options' attr with setopt in initExtra

home-manager's programs.zsh has no 'options' attribute.
Use 'setopt correct' and 'setopt interactive_comments' inside initExtra instead.
This commit is contained in:
luochen570
2026-05-26 12:50:23 +08:00
parent 14e57c9096
commit 88414eb346

View File

@@ -14,11 +14,14 @@
export PATH="$HOME/.hermes/node/bin:$PATH"
'';
# Shell 选项 - 对应 .zshrc 的 setopt
options = [ "correct" "interactive_comments" ];
# Shell 选项 - 对应 .zshrc 的 setoptNixOS 中需写在 initExtra 里)
# options 属性在 home-manager 中不存在,用 setopt 命令代替
# 初始化 - 对应 .zshrc 中的 Powerlevel10k instant prompt 和函数定义
initExtra = ''
# Shell options
setopt correct
setopt interactive_comments
# Powerlevel10k instant prompt
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"