Add Atuin as a replacement for bkd-i-search

This change adds a replacement option for bkd-i-search via atuin. It
also defaults to disabling the up arrow functionality of atuin as it
wouldn't be a drop in replacement.

Change-Id: Iedc9006ba4b80059e41de24b9be7e5177a815071
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/521
Reviewed-by: Skyler Grey <minion@clicks.codes>
Tested-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix
index 060cdf6..9eb874f 100644
--- a/modules/home/shell/default.nix
+++ b/modules/home/shell/default.nix
@@ -16,6 +16,16 @@
     replacements = {
       defaultEnable = lib.mkEnableOption "Enable replacing everything by default";
 
+      atuin = {
+        enable = lib.mkOption {
+          description = "Use atuin instead of bkd-i-search";
+          type = lib.types.bool;
+          default = config.chimera.shell.replacements.defaultEnable;
+          example = true;
+        };
+        enableUpArrow = lib.mkEnableOption "Pressing up arrow will enter atuin instead of scrolling back through history";
+      };
+
       eza.enable = lib.mkOption {
         description = "Use eza instead of ls";
         type = lib.types.bool;
@@ -82,6 +92,13 @@
       cat = lib.mkIf config.chimera.shell.replacements.bat.enable "${pkgs.bat}/bin/bat";
     };
 
+    programs.atuin = lib.mkIf config.chimera.shell.replacements.atuin.enable {
+      enable = true;
+      enableZshIntegration = config.chimera.shell.zsh.enable;
+      enableBashIntegration = config.chimera.shell.bash.enable;
+      flags = lib.mkIf (!config.chimera.shell.replacements.atuin.enableUpArrow) [ "--disable-up-arrow" ];
+    };
+
     programs.eza = lib.mkIf config.chimera.shell.replacements.eza.enable {
       enable = true;
       enableAliases = true;