nixos/zsh: use `escapeShelLArg' for shell aliases (#47471)

Previously single quotes were used by default for aliases and the module
never warned about possible collisions when having a shell alias which
relies on single quotes.

Adding `escapeShellArg` works around this fixes the issue and ensures that a
properly quoted value is written to `/etc/zshrc`.
This commit is contained in:
Maximilian Bosch 2018-09-28 23:42:55 +02:00 committed by xeji
parent c4bd58d337
commit 1e211a70cb

View File

@ -11,7 +11,7 @@ let
cfg = config.programs.zsh;
zshAliases = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "alias ${k}='${v}'") cfg.shellAliases
mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}") cfg.shellAliases
);
in