about summary refs log tree commit diff stats
path: root/modules/by-name/zs/zsh/module.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-25 13:03:17 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-25 13:03:58 +0200
commita260bcc36baa525bf189d51d05a557a63f66a9b7 (patch)
tree38825ae3e93f397661be507806f71142674059e6 /modules/by-name/zs/zsh/module.nix
parenthosts/tiamat: Enable steam for all hosts (diff)
downloadnixos-config-a260bcc36baa525bf189d51d05a557a63f66a9b7.zip
modules/zsh: Migrate away from deprecated `initExtra{,First}`
Diffstat (limited to '')
-rw-r--r--modules/by-name/zs/zsh/module.nix21
1 files changed, 11 insertions, 10 deletions
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