From c6e4ec39df78245f7ce678476ff068515763345b Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Fri, 13 Sep 2024 13:56:28 -0300 Subject: [PATCH] z-lua: add support for fish abbreviations --- modules/programs/z-lua.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/programs/z-lua.nix b/modules/programs/z-lua.nix index 37a8479ee..74dee31dc 100644 --- a/modules/programs/z-lua.nix +++ b/modules/programs/z-lua.nix @@ -77,16 +77,26 @@ in { })" ''; - programs.fish.shellInit = mkIf cfg.enableFishIntegration '' - source (${pkgs.z-lua}/bin/z --init fish ${ - concatStringsSep " " cfg.options - } | psub) - ''; - programs.bash.shellAliases = mkIf cfg.enableAliases aliases; programs.zsh.shellAliases = mkIf cfg.enableAliases aliases; - programs.fish.shellAliases = mkIf cfg.enableAliases aliases; + programs.fish = mkMerge [ + { + shellInit = mkIf cfg.enableFishIntegration '' + source (${pkgs.z-lua}/bin/z --init fish ${ + concatStringsSep " " cfg.options + } | psub) + ''; + } + + (mkIf (!config.programs.fish.preferAbbrs) { + shellAliases = mkIf cfg.enableAliases aliases; + }) + + (mkIf config.programs.fish.preferAbbrs { + shellAbbrs = mkIf cfg.enableAliases aliases; + }) + ]; }; }