atuin: add xonsh integration

This commit is contained in:
paki23 2024-05-31 00:24:43 +02:00
parent 7c60585f2e
commit 0726e1a805
No known key found for this signature in database
GPG key ID: 13160FFB4CEB03F2

View file

@ -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 {
${cfg.package}/bin/atuin 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"