mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
@@ -13,10 +13,12 @@ let
|
||||
types
|
||||
;
|
||||
|
||||
inherit (import ../lib.nix { inherit config lib; }) dotDirRel;
|
||||
inherit (import ../lib.nix { inherit config lib; }) dotDirRel mkShellVarPathStr;
|
||||
|
||||
cfg = config.programs.zsh;
|
||||
|
||||
shellVarPathArg = path: ''"${lib.escape [ "\\" "\"" "`" ] (mkShellVarPathStr path)}"'';
|
||||
|
||||
ohMyZshModule = types.submodule {
|
||||
options = {
|
||||
enable = lib.mkEnableOption "oh-my-zsh";
|
||||
@@ -98,7 +100,7 @@ in
|
||||
${optionalString (
|
||||
cfg.oh-my-zsh.plugins != [ ]
|
||||
) "plugins=(${escapeShellArgs cfg.oh-my-zsh.plugins})"}
|
||||
${optionalString (cfg.oh-my-zsh.custom != "") "ZSH_CUSTOM=${escapeShellArg cfg.oh-my-zsh.custom}"}
|
||||
${optionalString (cfg.oh-my-zsh.custom != "") "ZSH_CUSTOM=${shellVarPathArg cfg.oh-my-zsh.custom}"}
|
||||
${optionalString (cfg.oh-my-zsh.theme != "") "ZSH_THEME=${escapeShellArg cfg.oh-my-zsh.theme}"}
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user