bonfire/nixosConfigurations/common/hm/nushell.nix

81 lines
1.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
pkgs,
lib,
config,
hmConfig,
...
}: {
programs.nushell = {
enable = true;
# The config.nu can be anywhere you want if you like to edit your Nushell with Nu
#configFile.source = ./.../config.nu;
# for editing directly to config.nu
extraConfig = ''
let carapace_completer = {|spans|
carapace $spans.0 nushell $spans | from json
}
$env.config = {
show_banner: false,
completions: {
case_sensitive: false # case-sensitive completions
quick: true # set to false to prevent auto-selecting completions
partial: true # set to false to prevent partial filling of the prompt
algorithm: "fuzzy"
external: {
enable: true
max_results: 100
completer: $carapace_completer
}
}
}
'';
environmentVariables = {
GNUPGHOME = hmConfig.programs.gpg.homedir;
SSH_AUTH_SOCK = "/run/user/1000/ssh-agent";
};
};
# completion
programs.carapace = {
enable = true;
enableNushellIntegration = true;
enableBashIntegration = true;
};
# prompt
programs.starship = {
enable = true;
enableNushellIntegration = true;
enableBashIntegration = true;
settings = {
add_newline = true;
format = ''
$all $fill $time
$character
'';
fill = {
symbol = " ";
};
line_break = {
disabled = true;
};
directory = {
truncate_to_repo = false;
};
time = {
disabled = false;
use_12hr = true;
};
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
nix_shell = {
symbol = " ";
heuristic = true;
};
};
};
}