2 days of work

This commit is contained in:
Stefan Schwarz 2020-10-07 23:23:16 +02:00
parent ad427500ad
commit f8e261ad07
18 changed files with 391 additions and 32 deletions

View file

@ -5,6 +5,7 @@ let
in {
environment.systemPackages = with pkgs; [
bash
bash-completion
bat
direnv
fd
@ -18,7 +19,9 @@ in {
ripgrep
tcpdump
tmux
wget
z-lua
unzip
unstable.starship
(import ../packages/neovim.nix)
];
@ -46,28 +49,21 @@ in {
}
starship_precmd_user_func=set_win_title
pw() {
len=''${1:-$(( $RANDOM % 24 + 8 ))}
tr -dc a-zA-Z0-9 < /dev/urandom | head -c $len
echo
}
cdg() {
gitroot=$(until [ -d .git ]; do [ "$PWD" == "/" ] && exit 1; cd ..; done; echo $PWD)
if [ $? == 0 ]; then
precmd_user_func = "title"
cd $gitroot
else
echo "gitroot not found."
return 1
fi
}
. "$(fzf-share)/key-bindings.bash"
. "$(fzf-share)/completion.bash"
. <(z --init bash)
. <(direnv hook bash)
. ${pkgs.bash-completion}/etc/profile.d/bash_completion.sh
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
for script in "$HOME"/dotfiles/bashrc/*.sh; do
. "$script"
done
if [[ -z $DISPLAY ]] \
&& [[ $(tty) = /dev/tty1 ]] \
&& [[ "$USER" = "stefan" ]] \
&& [[ -x /run/current-system/sw/bin/startsway ]]
then
exec startsway
fi
'';