nix-dots/common/bash.nix

115 lines
2.5 KiB
Nix
Raw Normal View History

2025-05-16 18:11:06 -05:00
{lib, ...}: {
programs.bash = {
enable = true;
initExtra = ''
source /etc/profile
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin
'';
2025-10-03 21:11:48 -04:00
bashrcExtra = ''
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
'';
2025-05-16 18:11:06 -05:00
};
home = {
sessionVariables = {
EDITOR = "nvim";
GOPATH = "$HOME/tmp/go";
};
shellAliases = {
2025-12-24 14:35:48 -06:00
emacs = "emacs -nw";
2025-12-28 20:18:45 -06:00
estart = "systemctl --user start emacs";
estop = "systemctl --user stop emacs";
erestart = "systemctl --user restart emacs";
ec = "emacsclient -nw";
2025-05-16 18:11:06 -05:00
vi = "nvim";
vim = "nvim";
tl = "tmux list-sessions";
ta = "tmux attach";
rfc_date = "date --rfc-3339='seconds'";
2025-08-15 16:38:21 -05:00
lg = "lazygit";
2025-05-16 18:11:06 -05:00
};
};
programs.starship = {
enable = true;
settings = {
format = lib.concatStrings [
"[\\[](green)"
"$username"
"[@](blue)"
"$hostname"
":"
"$directory"
"[$git_branch$git_status](yellow)"
"$nix_shell"
"[\\]\\$](green) "
];
username = {
style_root = "red";
style_user = "green";
format = "[$user]($style)";
show_always = true;
aliases = {
foehammer = "foe";
};
};
hostname = {
ssh_only = false;
ssh_symbol = "!";
trim_at = ".";
style = "green";
format = "[$hostname]($style)[$ssh_symbol](red)";
};
directory = {
truncation_length = 3;
truncate_to_repo = true;
style = "green";
read_only = "(ro)";
read_only_style = "red";
home_symbol = "~";
use_os_path_sep = true;
format = "[$path]($style)[$read_only]($read_only_style)";
};
git_branch = {
symbol = "";
always_show_remote = false;
truncation_symbol = "..";
ignore_branches = [];
truncation_length = 7;
format = "\\(g-$branch";
};
nix_shell = {
format = "[\\($symbol$pure_msg$impure_msg\\)]($style)";
symbol = "n";
style = "blue";
impure_msg = " - \\(impure\\)";
pure_msg = "p";
};
git_status = {
style = "white";
format = "$ahead_behind$conflicted$modified\\)";
ahead = ">";
behind = "<";
diverged = "%";
up_to_date = "";
conflicted = "[!c](red)";
modified = "*";
};
};
enableBashIntegration = true;
};
}