nixos-configs/common/home/bash/default.nix

144 lines
3.5 KiB
Nix
Raw Normal View History

{
config,
lib,
...
}: let
inherit (lib) concatStrings fileContents;
inherit (config.vars) promptColors;
2024-01-22 11:09:37 -05:00
in {
imports = [./programs.nix];
2023-10-07 01:44:29 -04:00
2023-10-15 16:05:28 -04:00
programs = {
2024-01-22 11:09:37 -05:00
starship = {
enable = true;
enableBashIntegration = true;
settings = {
format = concatStrings [
""
"[](fg:${promptColors.firstColor})"
"[ ](bg:${promptColors.firstColor} fg:#090c0c)"
"[](bg:${promptColors.secondColor} fg:${promptColors.firstColor})"
"$username$hostname"
"[](fg:${promptColors.secondColor} bg:${promptColors.thirdColor})"
"$directory"
"[](fg:${promptColors.thirdColor} bg:${promptColors.fourthColor})"
"$git_branch"
2024-03-27 01:29:03 -04:00
"[](fg:${promptColors.fourthColor})$shlvl$nix_shell"
"\n$character"
];
username = {
show_always = true;
style_user = "fg:${promptColors.textColor} bg:${promptColors.secondColor}";
style_root = "fg:red bg:${promptColors.secondColor} blink";
format = "[ $user]($style)";
};
2023-10-07 01:44:29 -04:00
hostname = {
ssh_only = false;
style = "fg:${promptColors.textColor} bg:${promptColors.secondColor}";
format = "[@$hostname ]($style)";
};
2023-10-07 01:44:29 -04:00
directory = {
style = "fg:${promptColors.firstColor} bg:${promptColors.thirdColor}";
format = "[ $path ]($style)";
truncate_to_repo = false;
truncation_length = 0;
substitutions = {
"Documents" = "󰈙 ";
"Downloads" = " ";
"Music" = " ";
"Pictures" = " ";
};
2023-10-07 14:16:51 -04:00
};
2023-10-07 01:44:29 -04:00
git_branch = {
style = "fg:${promptColors.secondColor} bg:${promptColors.fourthColor}";
symbol = "";
format = "[ $symbol $branch ]($style)";
};
2023-10-07 14:16:51 -04:00
shlvl = {
disabled = false;
repeat = true;
symbol = "󰔳 ";
format = "[ $symbol]($style)";
threshold = 1;
};
2023-10-07 14:16:51 -04:00
nix_shell = {
symbol = " ";
format = "[ $symbol]($style)";
};
2023-10-07 14:16:51 -04:00
character = {
success_symbol = "[\\$](bold green)";
error_symbol = "[\\$](bold red)";
};
2023-10-07 14:16:51 -04:00
};
2023-10-07 01:44:29 -04:00
};
bash = {
enable = true;
enableCompletion = true;
2023-11-22 15:33:16 -05:00
historyFile = "\$HOME/.cache/.bash_history";
historyFileSize = 100000; # default
2023-11-22 15:33:16 -05:00
historySize = 10000; # default
historyControl = [
"erasedups"
"ignorespace"
];
historyIgnore = [
"ls"
"exit"
"logout"
];
shellOptions = [
"histappend"
"checkwinsize"
"extglob"
"globstar"
"checkjobs"
"autocd"
"cdspell"
"dirspell"
"dotglob"
];
shellAliases = {
# Add whitespace after, to allow
# sudo to inherit all other aliases
2023-11-22 15:33:16 -05:00
sudo = "sudo ";
2023-11-22 15:33:16 -05:00
ls = "ls -lah --color=auto";
tree = "tree -a -I node_modules";
cp = "cp -r";
};
#profileExtra = ''
#'';
bashrcExtra =
2024-06-09 22:49:30 -04:00
# bash
''
# Check if shell is interactive
[[ $- == *i* ]] || return 0
2024-01-22 11:09:37 -05:00
${fileContents ./config/dracula/less.sh}
${fileContents ./config/dracula/fzf.sh}
2024-01-22 11:09:37 -05:00
${fileContents ./config/colorgrid.sh}
${fileContents ./config/bashrc}
'';
#initExtra = ''
#'';
#logoutExtra = ''
#'';
};
2023-06-26 17:29:17 -04:00
};
}