-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·130 lines (106 loc) · 4.17 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·130 lines (106 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env bash
cleanup() {
echo "Error detected. Cleaning up"
rm -rf ~/.tmux ~/.tmux/plugins/tpm ~/.oh-my-zsh ~/.vim/bundle/Vundle.vim $HOME/.tmux.conf.local $HOME/.tmux/.tmux.conf ~/.fzf
exit 1
}
trap cleanup 1 2 3 6 14 15
pushd $(dirname "$0") >/dev/null
DIR=$(pwd)
popd >/dev/null >/dev/null
case $(uname) in
Linux) PKGMGR='sudo apt-get -y' ;;
Darwin) PKGMGR='brew' ;;
esac
PKGS="zsh curl git nvim cmake ctags ripgrep coreutils fzf zlib readline tmux keybase watch lsd jo jq gimp hugin pandoc git-delta font-hack-nerd-font fontforge asdf starship"
PYPKGS="pynvim ipython ipdb setuptools wheel"
PYPKG_BINS="youtube-dl magic-wormhole awscli twine grip dunk pre-commit httpx[cli] llm"
$LOG="/tmp/dsetup.log"
echo "Updating your packages and install pre-requisites (logging to $LOG)"
$PKGMGR update >>$LOG
$PKGMGR install $(echo $PKGS) >>$LOG
echo "Creating directories and links ... will overwrite"
pushd $HOME >/dev/null
mkdir -p ~/.vim/plugins ~/.vim/colors ~/.vim/autoload ~/.vim/bundle ~/.config ~/bin ~/sandbox ~/.ssh ~/Envs ~/.config/nvim/
ln -sfv $DIR/.vimrc .vimrc
ln -sfv $DIR/init.vim ~/.config/nvim/init.vim
ln -sfv $DIR/.gitconfig .gitconfig
ln -sfv $DIR/.gitignore .gitignore
ln -sfv $DIR/.zshrc .zshrc
ln -sfv $DIR/.zsh_plugins.txt .zsh_plugins.txt
ln -sfv $DIR/.aliases .aliases
ln -sfv $DIR/.envs .envs
ln -sfv $DIR/.ackrc .ackrc
cp -v $DIR/.ctags .ctags
echo "---exclude=@$HOME/.ctagsignore" >>.ctags
ln -sfv $DIR/.ctagsignore .ctagsignore
ln -sfv $DIR/.hammerspoon .
ln -sfv $DIR/bin/sag.py ~/bin/sag
ln -sfv $DIR/bin/time_ms ~/bin/time_ms
ln -sfv $DIR/pyproject.toml pyproject.toml
cp -v $DIR/ssh_config ~/.ssh/config
echo "Cloning claude configs ... "
mkdir ~/.claude
git clone https://github.com/danwald/cc.git ~/.claude >/dev/null
echo "Installing oh-my-zsh .. "
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh >/dev/null
echo "Installing antidote .. "
git clone --depth=1 https://github.com/mattmc3/antidote.git ~/.antidote
echo "Changing your shell to zsh .."
chsh -s $(which zsh) $USER
echo "Installing gpakosz's .tmux .."
pushd $HOME >/dev/null
git clone https://github.com/gpakosz/.tmux.git >/dev/null
ln -sfv .tmux/.tmux.conf
cp -v .tmux/.tmux.conf.local .
popd >/dev/null
echo "Downloading Tmux plugin Manager"
echo "Manually update ~/.tmux.conf.local from .danwald.tmux.local"
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm >/dev/null
echo "Getting kubectl aliases"
curl -s -o ~/.kubectl_aliases https://raw.githubusercontent.com/ahmetb/kubectl-aliases/refs/heads/master/.kubectl_aliases
read -p "Stable python version? " STABLE_PY3
echo "installing $STABLE_PY3"
echo "export STABLE_PY3=$STABLE_PY3" >>~/.envs_local
asdf plugin add nodejs
asdf plugin add python
asdf plugin add golang
asdf install golang latest
asdf install nodejs latest
asdf install python latest
asdf install python $STABLE_PY3
asdf set -u nodejs latest
asdf set -u golang latest
asdf set -u python $STABLE_PY3
asdf list
asdf current
echo "install uv"
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "installing python libs to global"
python -m pip install -U pip $PYPKGS
asdf reshim python $STABLE_PY3
echo "installing python bins with uv"
for pkg in $PYPKG_BINS; do
uv tool install "$pkg"
done
echo "no global pip installs allowed!"
pip config set global.require-virtualenv True
pushd $HOME >/dev/null
git clone https://github.com/rupa/z.git >/dev/null
popd >/dev/null
echo "installing plug nvim plugin manager and all plugins"
pushd $HOME >/dev/null
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
nvim +PlugInstall +qall
popd >/dev/null
echo "installing docker/kubectl completions"
pushd $HOME >/dev/null
mkdir -p ~/.docker/completions
mkdir -p ~/.kube/completions
docker completion zsh >~/.docker/completions/_docker
kubectl completions zsh >~/.kube/completions/_kubectl
popd >/dev/null
echo "You need to install https://larsenwork.com/monoid/ font, patch retina via https://github.com/ryanoasis/nerd-fonts/blob/master/readme.md#font-patcher"
echo "All good in the hood. Re-login and don't overwrite the zsh config when prompted"
popd >/dev/null