mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
atuin: enable nushell integration
This commit is contained in:
parent
fa980cc985
commit
2dcb61d396
1 changed files with 21 additions and 0 deletions
|
@ -85,6 +85,14 @@ in {
|
|||
of options.
|
||||
'';
|
||||
};
|
||||
|
||||
enableNushellIntegration = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable Nushell integration.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = let flagsStr = escapeShellArgs cfg.flags;
|
||||
|
@ -114,5 +122,18 @@ in {
|
|||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
||||
${cfg.package}/bin/atuin init fish ${flagsStr} | source
|
||||
'';
|
||||
|
||||
programs.nushell = mkIf cfg.enableNushellIntegration {
|
||||
extraEnv = ''
|
||||
let atuin_cache = "${config.xdg.cacheHome}/atuin"
|
||||
if not ($atuin_cache | path exists) {
|
||||
mkdir $atuin_cache
|
||||
}
|
||||
${cfg.package}/bin/atuin init nu | save --force ${config.xdg.cacheHome}/atuin/init.nu
|
||||
'';
|
||||
extraConfig = ''
|
||||
source ${config.xdg.cacheHome}/atuin/init.nu
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue