summary refs log tree commit diff
path: root/nixos/modules/programs/zsh/zsh.nix
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-09-28 23:42:55 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-09-28 23:42:55 +0200
commit1e211a70cbdaf230a18ea4cb67a959039d5c2ddb (patch)
tree242d14d98a3918b117be59d889b1cd8b9ed9584a /nixos/modules/programs/zsh/zsh.nix
parentc4bd58d33785280596fb20bf53d556262a438123 (diff)
downloadnixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar
nixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.gz
nixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.bz2
nixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.lz
nixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.xz
nixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.zst
nixpkgs-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.zip
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`.
Diffstat (limited to 'nixos/modules/programs/zsh/zsh.nix')
-rw-r--r--nixos/modules/programs/zsh/zsh.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix
index b4ca8730958..865d148c162 100644
--- a/nixos/modules/programs/zsh/zsh.nix
+++ b/nixos/modules/programs/zsh/zsh.nix
@@ -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