about summary refs log tree commit diff stats
path: root/modules/by-name/zs/zsh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/zs/zsh/module.nix24
1 files changed, 22 insertions, 2 deletions
diff --git a/modules/by-name/zs/zsh/module.nix b/modules/by-name/zs/zsh/module.nix
index cb1bb086..fd99031b 100644
--- a/modules/by-name/zs/zsh/module.nix
+++ b/modules/by-name/zs/zsh/module.nix
@@ -3,6 +3,7 @@
   lib,
   shell_library,
   system,
+  pkgs,
   ...
 }: let
   cfg = config.soispha.programs.zsh;
@@ -10,9 +11,25 @@
   zDotDir = ".config/zsh";
 
   sourceFile = path: "source ${path}\n";
+
+  extraFiles = builtins.concatStringsSep "\n" (
+    builtins.map sourceFile (
+      builtins.attrValues cfg.integrations
+    )
+  );
 in {
   options.soispha.programs.zsh = {
     enable = lib.mkEnableOption "zsh";
+
+    integrations = lib.mkOption {
+      type = lib.types.attrsOf lib.types.path;
+      example = ''
+        {
+          atuin = ./integrations/atuin.zsh;
+        }
+      '';
+      default = {};
+    };
   };
 
   config = lib.mkIf cfg.enable {
@@ -105,6 +122,9 @@ in {
           lib.modules.mkMerge
           [
             start
+
+            extraFiles
+
             end
           ];
 
@@ -114,8 +134,8 @@ in {
         };
 
         shellAliases = {
-          ll = ". ll";
-          lm = ". lm";
+          ll = ". ${lib.getExe pkgs.ll}";
+          lm = ". ${lib.getExe pkgs.lm}";
         };
       };
     };