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 HISTFILESIZE=2000
HISTCONTROL=ignoreboth:erasedups 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 GPG_TTY=$(tty)
export THEME="${THEME:-midnight}" export THEME="${THEME:-midnight}"
export FZF_COMPLETION_TRIGGER=';' export FZF_COMPLETION_TRIGGER=';'
export FZF_TMUX=1 export FZF_TMUX=1
eval "$(fzf --bash)"
eval "$(zoxide init bash)"
eval "$(direnv hook bash)"
eval "$(starship init bash)"
fzf-config-widget() { fzf-config-widget() {
local file local file
file="$(FZF_CTRL_T_COMMAND="fd --type file --hidden . \"$XDG_CONFIG_HOME\"/nix | sed \"s|$HOME|~|g\"" fzf --reverse)" || return 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 $if mode=vi
set keymap vi-command set keymap vi-command
"\C-l": clear-screen
"\C-p": previous-history "\C-p": previous-history
"\C-n": next-history "\C-n": next-history
"\C-j": backward-char "\C-j": backward-char
@ -16,6 +17,7 @@ $if mode=vi
"\e[3~": delete-char "\e[3~": delete-char
set keymap vi-insert set keymap vi-insert
"\C-l": clear-screen
"\C-p": previous-history "\C-p": previous-history
"\C-n": next-history "\C-n": next-history
"\C-j": backward-char "\C-j": backward-char

View file

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

View file

@ -84,16 +84,7 @@ in
shell = pkgs.bash; shell = pkgs.bash;
}; };
programs.bash = { programs.bash.enable = true;
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.hyprland = { programs.hyprland = {
enable = true; enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland; portalPackage = pkgs.xdg-desktop-portal-hyprland;