From 379e2c694b9cb3f9a26e9620a36fb018f0b4ca21 Mon Sep 17 00:00:00 2001 From: Nikita Uvarov Date: Thu, 7 Sep 2017 22:21:00 +0200 Subject: [PATCH] zsh: move aliases definitions after initExtra Same motivation as in https://github.com/NixOS/nixpkgs/pull/28378. zsh.initExtra parameter can be used by external modules which can redefine user aliases. This change will give user-defined aliases the highest priority. --- modules/misc/news.nix | 13 +++++++++++++ modules/programs/zsh.nix | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 9a77dee87..0fdb66049 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -107,6 +107,19 @@ in config = { news.entries = [ + { + time = "2017-09-12T13:11:48+00:00"; + condition = ( + config.programs.zsh.enable && + config.programs.zsh.shellAliases != {} + ); + message = '' + Aliases defined in 'programs.zsh.shellAliases' + are now have the highest priority. Such aliases will + not be redefined by the code in 'programs.zsh.initExtra' + or any external plugins. + ''; + } { time = "2017-09-10T22:15:19+00:00"; condition = config.programs.zsh.enable; diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index ab9d226b4..24c5e098e 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -241,9 +241,9 @@ in source "$HOME/.zsh/plugins/${plugin.name}/${plugin.file}" '') cfg.plugins)} - ${aliasesStr} - ${cfg.initExtra} + + ${aliasesStr} ''; }) (mkIf cfg.oh-my-zsh.enable {