-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·174 lines (145 loc) · 3.75 KB
/
setup.sh
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/bin/bash
# install git
which -s git
if [[ $? != 0 ]] ; then
printf "\nMANUALLY INSTALL GIT TO CONTINUE\n"
exit 1
fi
# symlink global gitignore
printf "\nSYMLINKING GLOBAL GITIGNORE:\n"
if [ -f ${HOME}/.gitignore ]; then
read -p "local ~/.gitignore already found. Would you like to replace your local ~/.gitignore ? " -n 1 -r
echo # (optional) move to a new line
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "aborting script."
exit 1
fi
fi
# install brew
which -s brew
if [[ $? != 0 ]] ; then
printf "\nINSTALL HOMEBREW MANUALLY TO CONTINUE.\n"
printf "https://brew.sh"
exit 1
else
printf "\nUPDATING HOMEBREW:\n"
brew update
fi
# install git stuff
brew install gpg2 gnupg pinentry-mac
ln -fs ${HOME}/.secrets/dotfiles/.gnupg ${HOME}/.gnupg
chmod 700 ~/.gnupg
git config --global push.default current
ln -fs ${HOME}/code/personal/configs/dotfiles/gitignore ${HOME}/.gitignore
git config --global core.excludesfile ~/.gitignore
git config --global gpg.program $(which gpg)
git config --global user.signingkey 60F96B0F
git config --global commit.gpgsign true
# install zsh stuff
ln -fs ${HOME}/code/personal/configs/dotfiles/zshrc ${HOME}/.zshrc
brew install zsh-history-substring-search
# install terraform stuff
brew install tfenv
# flux stuff
brew install fluxcd/tap/flux
# talos stuff
ln -fs ${HOME}/.secrets/dotfiles/.talos ${HOME}/.talos
# install nvim
which -s nvim
if [[ $? != 0 ]] ; then
printf "\nINSTALLING NVIM"
brew install nvim
mkdir -p ~/.config
ln -fs ${HOME}/code/personal/configs/nvim ${HOME}/.config/nvim
fi
# install silver-searcher
which -s ag
if [[ $? != 0 ]] ; then
printf "\nINSTALLING SILVER_SEARCHER:\n"
brew install the_silver_searcher
fi
# install fzf for fuzzy vim file search
which -s gawk
if [[ $? != 0 ]] ; then
printf "\nINSTALLING GAWK:\n"
brew install gawk
fi
# install fzf for fuzzy vim file search
which -s fzf
if [[ $? != 0 ]] ; then
printf "\nINSTALLING FZF:\n"
brew install fzf
$(brew --prefix)/opt/fzf/install --completion --key-bindings --update-rc
fi
# install fzf for fuzzy vim file search
which -s macdown
if [[ $? != 0 ]] ; then
printf "\nINSTALLING MACDOWN:\n"
brew install --cask macdown
fi
# ln -fs ${HOME}/code/personal/configs/dotfiles/vimrc ${HOME}/.vimrc
# install fnm
which -s fnm
if [[ $? != 0 ]] ; then
printf "\nINSTALLING FNM:\n"
brew install Schniz/tap/fnm
fi
# install tree
which -s tree
if [[ $? != 0 ]] ; then
printf "\nINSTALLING TREE:\n"
brew install tree
fi
# install bat
which -s bat
if [[ $? != 0 ]] ; then
printf "\nINSTALLING BAT:\n"
brew install bat
fi
# use vim from brew instead of one shipped with OS
# if [[ "$(which vim)" != '/usr/local/bin/vim' ]]; then
# brew install vim
# fi
which -s kubectl
if [[ $? != 0 ]] ; then
printf "\nINSTALLING KUBECTL:\n"
brew install kubectl
fi
ln -fs ${HOME}/.secrets/dotfiles/.kube ${HOME}/.kube
which -s jq
if [[ $? != 0 ]] ; then
printf "\nINSTALLING JQ:\n"
brew install jq
fi
which -s curl
if [[ $? != 0 ]] ; then
printf "\nINSTALLING CURL:\n"
brew install curl
fi
# symlink .aws
printf "\nSYMLINKING AWS CONFIG:\n"
if [ -d ${HOME}/.aws ]; then
read -p "local ~/.aws already found. Would you like to replace your local ~/.aws ? " -n 1 -r
echo # (optional) move to a new line
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "aborting script."
exit 1
fi
fi
ln -fs ${HOME}/.secrets/dotfiles/.aws ${HOME}/.aws
# symlink .ssh
printf "\nSYMLINKING SSH CONFIG:\n"
if [ -d ${HOME}/.ssh ]; then
read -p "local ~/.ssh already found. Would you like to replace your local ~/.ssh ? " -n 1 -r
echo # (optional) move to a new line
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "aborting script."
exit 1
fi
fi
ln -fs ${HOME}/.secrets/dotfiles/.ssh ${HOME}/.ssh
# setup python
brew install openssl readline sqlite3 xz zlib
brew install pyenv
echo
echo "finished"