From e136408ca918eed36cbd54557811b551bb841334 Mon Sep 17 00:00:00 2001 From: paki23 Date: Fri, 31 May 2024 00:24:43 +0200 Subject: [PATCH] atuin: add xonsh integration --- modules/programs/atuin.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index a27bcf860..f6b77e27b 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -51,6 +51,16 @@ in { ''; }; + enableXonshIntegration = mkOption { + default = true; + type = types.bool; + description = '' + Whether to enable Atuin's Xonsh integration. + + If enabled, this will bind the up-arrow key to open the Atuin history. + ''; + }; + flags = mkOption { default = [ ]; type = types.listOf types.str; @@ -124,6 +134,10 @@ in { ${lib.getExe cfg.package} init fish ${flagsStr} | source ''; + programs.xonsh.xonshrc = mkIf cfg.enableXonshIntegration '' + execx($(${cfg.package}/bin/atuin init xonsh)) + ''; + programs.nushell = mkIf cfg.enableNushellIntegration { extraEnv = '' let atuin_cache = "${config.xdg.cacheHome}/atuin"