zsh: fix oh-my-zsh custom path expansion

Preserve shell-variable paths for programs.zsh.oh-my-zsh.custom while
still escaping values for a double-quoted shell assignment.

This restores runtime expansion for values like $HOME/extra/zsh, which
otherwise became a literal path after the previous escapeShellArg
change.
This commit is contained in:
Austin Horstman
2026-06-01 22:47:50 -05:00
parent a7a4158831
commit 07c723c3fe
3 changed files with 36 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
zsh-history-path-zdotdir-variable = import ./history-path.nix "zdotdir-variable";
zsh-history-substring-search = ./history-substring-search.nix;
zsh-legacy-warning = ./legacy-warning.nix;
zsh-oh-my-zsh-custom = ./oh-my-zsh-custom.nix;
zsh-plugins-completions-renamed = ./plugins-completions-renamed.nix;
zsh-siteFunctions-mkcd = ./siteFunctions-mkcd.nix;
zsh-plugins = ./plugins.nix;

View File

@@ -0,0 +1,31 @@
{
config = {
programs.zsh = {
enable = true;
oh-my-zsh = {
enable = true;
custom = "$HOME/extra/zsh";
theme = "sigma";
};
};
home.file.omz-zsh-theme = {
source = builtins.toFile "sigma.zsh-theme" ''
echo sigma
'';
target = "extra/zsh/themes/sigma.zsh-theme";
};
test.stubs = {
oh-my-zsh = { };
zsh = { };
};
nmt.script = ''
assertFileContains home-files/.zshrc 'ZSH_CUSTOM="$HOME/extra/zsh"'
assertFileContains home-files/.zshrc 'ZSH_THEME=sigma'
assertFileExists home-files/extra/zsh/themes/sigma.zsh-theme
'';
};
}