nix-config/modules/bash/default.nix
2025-09-20 22:33:37 +02:00

37 lines
865 B
Nix

{
programs.bash = {
enable = true;
enableCompletion = true;
sessionVariables = {
GPG_TTY = "$(tty)";
};
shellAliases = {
"ff" = "${./bin/ff.sh}";
"ipl" = "ifconfig | grep \"inet \" | grep -v 127.0.0.1 | awk '{print $2}' | head -n 1";
"ipp" = "curl -4 ifconfig.me";
"lg" = "lazygit";
"g" = "git";
"xsrc" = "source ~/.bashrc && source .bash_profile";
};
profileExtra = ''
export PATH=\
/run/current-system/sw/bin:\
/opt/homebrew/bin:$PATH
'';
bashrcExtra = ''
# FNM
eval "$(fnm env --use-on-cd --shell bash)"
# emacs-libvterm
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
&& [[ -n "$EMACS_VTERM_PATH" ]] \
&& [[ -f "$EMACS_VTERM_PATH/etc/emacs-vterm-bash.sh" ]]; then
source "$EMACS_VTERM_PATH"
fi
'';
};
}