From a260bcc36baa525bf189d51d05a557a63f66a9b7 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 25 Apr 2025 13:03:17 +0200 Subject: modules/zsh: Migrate away from deprecated `initExtra{,First}` --- modules/by-name/zs/zsh/module.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'modules/by-name/zs') diff --git a/modules/by-name/zs/zsh/module.nix b/modules/by-name/zs/zsh/module.nix index fd99031b..72e49737 100644 --- a/modules/by-name/zs/zsh/module.nix +++ b/modules/by-name/zs/zsh/module.nix @@ -13,7 +13,10 @@ sourceFile = path: "source ${path}\n"; extraFiles = builtins.concatStringsSep "\n" ( - builtins.map sourceFile ( + builtins.map (value: + if builtins.isPath value + then (sourceFile value) + else value) ( builtins.attrValues cfg.integrations ) ); @@ -22,7 +25,7 @@ in { enable = lib.mkEnableOption "zsh"; integrations = lib.mkOption { - type = lib.types.attrsOf lib.types.path; + type = lib.types.attrsOf (lib.types.either lib.types.path lib.types.str); example = '' { atuin = ./integrations/atuin.zsh; @@ -92,16 +95,11 @@ in { setopt VI ''; - initExtraFirst = - sourceFile ./config/zsh-init.zsh - + '' - SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}} - ''; - - initExtra = let + initContent = let start = lib.modules.mkBefore ( # NOTE: This must be before the insult, as we otherwise override the previous handler <2024-02-28> - sourceFile ./config/command_not_found/command_not_found.sh + sourceFile ./config/zsh-init.zsh + + sourceFile ./config/command_not_found/command_not_found.sh + sourceFile ./config/command_not_found/command_not_found_insult.sh + sourceFile ./config/custom_cursor.zsh + sourceFile ./config/edit_command_line.zsh @@ -117,6 +115,9 @@ in { + sourceFile ./config/keymaps/viopp.zsh + sourceFile ./config/keymaps/visual.zsh + sourceFile ./config/keymaps_end.zsh + + '' + SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}} + '' ); in lib.modules.mkMerge -- cgit 1.4.1