From 5056fb39f1fc5fcc70c734afdca1fdee9d796a40 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sat, 13 May 2023 00:17:07 +0300 Subject: [PATCH] feat(shell): add support for `atuin` --- modules/home-manager/reo101-shell.nix | 32 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/modules/home-manager/reo101-shell.nix b/modules/home-manager/reo101-shell.nix index f89f860..e4a9f32 100644 --- a/modules/home-manager/reo101-shell.nix +++ b/modules/home-manager/reo101-shell.nix @@ -18,6 +18,11 @@ in type = types.str; default = "${config.home.username}"; }; + atuin = mkOption { + description = "Integrate with atuin"; + type = types.bool; + default = true; + }; direnv = mkOption { description = "Integrate with direnv"; type = types.bool; @@ -45,11 +50,14 @@ in zsh starship ] + (optionals cfg.atuin [ + atuin + ]) (optionals cfg.direnv [ - zoxide + direnv ]) (optionals cfg.zoxide [ - direnv + zoxide ]) ]; @@ -78,11 +86,20 @@ in initExtra = builtins.concatStringsSep "\n" [ - (optionalString cfg.direnv '' - eval "$(${pkgs.zoxide}/bin/zoxide init zsh)" + (optionalString cfg.atuin '' + export ATUIN_NOBIND="true" + eval "$(${pkgs.atuin}/bin/atuin init zsh)" + function zvm_after_init() { + # bindkey '^r' _atuin_search_widget + zvm_bindkey viins '^R' _atuin_search_widget + } '') + # NOTE: done by `programs.direnv` + # (optionalString cfg.direnv '' + # eval "$(${pkgs.direnv}/bin/direnv hook zsh)" + # '') (optionalString cfg.zoxide '' - eval "$(${pkgs.direnv}/bin/direnv hook zsh)" + eval "$(${pkgs.zoxide}/bin/zoxide init zsh)" '') cfg.extraConfig ]; @@ -314,8 +331,3 @@ in maintainers = with lib.maintainers; [ reo101 ]; }; } - - - - -