summary refs log tree commit diff
path: root/nixos/modules/programs
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
parentc4bd58d33785280596fb20bf53d556262a438123 (diff)
downloadnixlib-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar
nixlib-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.gz
nixlib-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.bz2
nixlib-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.lz
nixlib-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.xz
nixlib-1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.tar.zst
nixlib-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')
-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 b4ca8730958c..865d148c1629 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