fix(bash): shell integration

This commit is contained in:
Barrett Ruth 2026-02-18 12:39:49 -05:00
parent c3e5986aeb
commit 9c1fc433e4
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
4 changed files with 24 additions and 33 deletions

View file

@ -10,23 +10,11 @@ HISTSIZE=2000
HISTFILESIZE=2000
HISTCONTROL=ignoreboth:erasedups
alias ls='eza'
alias l='ls --color=auto --group-directories-first'
alias ll='l -alF'
alias la='ll -R'
alias g='git'
alias nv='nvim'
export GPG_TTY=$(tty)
export THEME="${THEME:-midnight}"
export FZF_COMPLETION_TRIGGER=';'
export FZF_TMUX=1
eval "$(fzf --bash)"
eval "$(zoxide init bash)"
eval "$(direnv hook bash)"
eval "$(starship init bash)"
fzf-config-widget() {
local file
file="$(FZF_CTRL_T_COMMAND="fd --type file --hidden . \"$XDG_CONFIG_HOME\"/nix | sed \"s|$HOME|~|g\"" fzf --reverse)" || return

View file

@ -9,6 +9,7 @@ set show-all-if-ambiguous on
$if mode=vi
set keymap vi-command
"\C-l": clear-screen
"\C-p": previous-history
"\C-n": next-history
"\C-j": backward-char
@ -16,6 +17,7 @@ $if mode=vi
"\e[3~": delete-char
set keymap vi-insert
"\C-l": clear-screen
"\C-p": previous-history
"\C-n": next-history
"\C-j": backward-char

View file

@ -192,20 +192,26 @@ in
}
'';
programs.bash = lib.mkIf (!hostConfig.isNixOS) {
programs.bash = {
enable = true;
shellAliases = {
ls = "eza";
l = "ls --color=auto --group-directories-first";
ll = "l -alF";
la = "ll -R";
g = "git";
nv = "nvim";
};
initExtra = ''
source "${pkgs.blesh}/share/blesh/ble.sh" --noattach
export INPUTRC="$HOME/.config/nix/config/bash/inputrc"
export THEME="''${THEME:-midnight}"
[ -f "$HOME/.config/nix/config/bash/bashrc" ] && . "$HOME/.config/nix/config/bash/bashrc"
[[ ''${BLE_VERSION-} ]] && ble-attach
'';
};
programs.starship = {
enable = true;
enableBashIntegration = false;
enableBashIntegration = true;
settings = {
format = lib.concatStrings [
"$directory"
@ -217,15 +223,19 @@ in
];
add_newline = true;
character = {
success_symbol = "[>](bold)";
success_symbol = "[>](bold magenta)";
error_symbol = "[>](bold red)";
vimcmd_symbol = "[<](bold)";
vimcmd_symbol = "[<](bold magenta)";
};
directory = {
style = "bold blue";
truncation_length = 0;
truncate_to_repo = false;
};
git_branch.format = "[$branch]($style) ";
git_branch = {
format = "[$branch]($style) ";
style = "242";
};
git_status = {
format = "([$all_status$ahead_behind]($style) )";
ahead = "^";
@ -247,7 +257,7 @@ in
programs.fzf = {
enable = true;
enableBashIntegration = false;
enableBashIntegration = true;
defaultCommand = "rg --files --hidden";
defaultOptions = [
"--bind=ctrl-a:select-all"
@ -263,18 +273,18 @@ in
programs.eza = {
enable = true;
enableBashIntegration = false;
enableBashIntegration = true;
git = true;
};
programs.zoxide = {
enable = true;
enableBashIntegration = false;
enableBashIntegration = true;
};
programs.direnv = {
enable = true;
enableBashIntegration = false;
enableBashIntegration = true;
nix-direnv.enable = true;
config.global = {
hide_env_diff = true;

View file

@ -84,16 +84,7 @@ in
shell = pkgs.bash;
};
programs.bash = {
enable = true;
shellInit = ''
export INPUTRC="$HOME/.config/nix/config/bash/inputrc"
export THEME="midnight"
'';
interactiveShellInit = ''
[ -f "$HOME/.config/nix/config/bash/bashrc" ] && . "$HOME/.config/nix/config/bash/bashrc"
'';
};
programs.bash.enable = true;
programs.hyprland = {
enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;