nixos-configs/nixos/home/bashdots.nix

162 lines
4.1 KiB
Nix
Raw Normal View History

2023-10-06 00:14:23 -04:00
{ lib, ... }:
2023-06-26 17:29:17 -04:00
{
2023-10-07 22:08:25 -04:00
programs.starship = let
textColor = "#e3e5e5";
firstColor = "#bd93f9";
secondColor = "#715895";
thirdColor = "#382c4a";
fourthColor = "#120e18";
in {
2023-10-07 01:44:29 -04:00
enable = true;
enableBashIntegration = true;
settings = {
format = lib.concatStrings [
""
2023-10-07 22:08:25 -04:00
"[](fg:${firstColor})"
"[ ](bg:${firstColor} fg:#090c0c)"
"[](bg:${secondColor} fg:${firstColor})"
2023-10-07 01:44:29 -04:00
"$username$hostname"
2023-10-07 14:16:51 -04:00
"$sudo"
2023-10-07 22:08:25 -04:00
"[](fg:${secondColor} bg:${thirdColor})"
2023-10-07 01:44:29 -04:00
"$directory"
2023-10-07 22:08:25 -04:00
"[](fg:${thirdColor} bg:${fourthColor})"
2023-10-07 01:44:29 -04:00
"$git_branch"
2023-10-07 22:08:25 -04:00
"[](fg:${fourthColor})"
"\n$shlvl$nix_shell$character"
2023-10-07 01:44:29 -04:00
];
2023-10-07 14:16:51 -04:00
sudo = {
disabled = false;
2023-10-07 22:08:25 -04:00
style = "fg:${textColor} bg:${secondColor}";
2023-10-07 14:16:51 -04:00
format = "[as root ]($style)";
};
2023-10-07 01:44:29 -04:00
username = {
show_always = true;
2023-10-07 22:08:25 -04:00
style_user = "fg:${textColor} bg:${secondColor}";
style_root = "fg:red bg:${secondColor} blink";
2023-10-07 01:44:29 -04:00
format = "[ $user]($style)";
};
hostname = {
ssh_only = false;
2023-10-07 22:08:25 -04:00
style = "fg:${textColor} bg:${secondColor}";
2023-10-07 01:44:29 -04:00
format = "[@$hostname ]($style)";
};
directory = {
2023-10-07 22:08:25 -04:00
style = "fg:${firstColor} bg:${thirdColor}";
2023-10-07 01:44:29 -04:00
format = "[ $path ]($style)";
truncate_to_repo = false;
2023-10-07 01:57:16 -04:00
truncation_length = 0;
2023-10-07 01:44:29 -04:00
2023-10-07 14:16:51 -04:00
substitutions = {
"Documents" = "󰈙 ";
"Downloads" = " ";
"Music" = " ";
"Pictures" = " ";
};
2023-10-07 01:44:29 -04:00
};
git_branch = {
2023-10-07 22:08:25 -04:00
style = "fg:${secondColor} bg:${fourthColor}";
2023-10-07 01:44:29 -04:00
symbol = "";
format = "[ $symbol $branch ]($style)";
};
2023-10-07 14:16:51 -04:00
shlvl = {
disabled = false;
repeat = true;
symbol = "󰔳 ";
format = "[$symbol]($style)";
threshold = 1;
};
nix_shell = {
symbol = " ";
format = "[$symbol]($style)";
};
character = {
success_symbol = "[\\$](bold green)";
error_symbol = "[\\$](bold red)";
};
2023-10-07 01:44:29 -04:00
};
};
2023-06-26 17:29:17 -04:00
programs.bash = { # TODO: deal with root dotfiles
enable = true;
enableCompletion = true;
#enableVteIntegration = false; what is this?
historyFile = "\$HOME/.cache/.bash_history";
historyFileSize = 100000; # default
historySize = 10000; # default
historyControl = [
"erasedups"
"ignorespace"
];
historyIgnore = [
"ls"
"exit"
"logout"
];
shellOptions = [
"histappend"
"checkwinsize"
"extglob"
"globstar"
"checkjobs"
"autocd"
"cdspell"
"dirspell"
"dotglob"
2023-09-29 23:46:34 -04:00
];
2023-06-26 17:29:17 -04:00
shellAliases = {
sudo = "sudo ";
frick = "sudo $(fc -ln -1)";
nivm = "nvim";
nivim = "nvim";
2023-06-26 17:29:17 -04:00
tmux = "tmux -2";
ls = "ls -lah --color=auto";
cp = "cp -r";
chore = "(cd ~/.nix/nixos; git add flake.lock; git commit -m 'chore: update flake.lock'; git push)";
2023-06-26 17:29:17 -04:00
tup = "tailscale up --login-server https://headscale.nelim.org";
pc = "mosh matt@10.0.0.248 -- tmux -2u new -At laptop";
oksys = "mosh matt@10.0.0.213 -- tmux -2u new -At laptop";
pve = "mosh matt@10.0.0.121 -- tmux -2u new -At laptop";
mc = "mosh mc@10.0.0.124 -- tmux -2u new -At laptop";
pod = "mosh matt@10.0.0.121 -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'";
jelly = "mosh matt@10.0.0.121 -- ssh -t matt@10.0.0.123 'tmux -2u new -At laptop'";
qbit = "mosh matt@10.0.0.121 -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'";
};
sessionVariables = { # see configuration.nix
2023-06-26 17:29:17 -04:00
};
profileExtra = ''
export POKE=true
[[ -f ~/.bashrc ]] && . ~/.bashrc
'';
bashrcExtra = ''
2023-10-06 00:14:23 -04:00
${lib.strings.fileContents ../../config/bash/dracula/less.sh}
${lib.strings.fileContents ../../config/bash/dracula/fzf.sh}
2023-07-09 13:08:30 -04:00
2023-10-06 00:14:23 -04:00
${lib.strings.fileContents ../../config/bash/colorgrid.sh}
${lib.strings.fileContents ../../config/bash/bashrc}
2023-06-26 17:29:17 -04:00
'';
#initExtra = ''
#'';
#logoutExtra = ''
#'';
};
}