/
dotfiles_mac_setup.sh
160 lines (125 loc) · 3.86 KB
/
dotfiles_mac_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
#!/bin/sh
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\\n$fmt\\n" "$@"
}
if ! command -v brew >/dev/null; then
fancy_echo "Installing Homebrew ..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH="/usr/local/bin:$PATH"
fi
fancy_echo "Updating Homebrew formulae ..."
brew update --force # https://github.com/Homebrew/brew/issues/1151
fancy_echo "Installing Homebrew packages ..."
brew bundle --file=- <<EOF
# tap "thoughtbot/formulae"
# tap "homebrew/services"
# Unix
# tap "universal-ctags/universal-ctags"
# brew "universal-ctags", args: ["HEAD"]
# Heroku
# tap "heroku/brew"
# brew "heroku/brew/heroku"
tap "puma/puma"
brew "puma/puma/puma-dev"
brew "git"
brew "gh"
brew "imagemagick"
brew "rcm"
brew "the_silver_searcher"
brew "tmux"
# Programming language prerequisites and package managers
# brew "libyaml" # should come after openssl
# brew "coreutils"
# brew "yarn"
brew "direnv"
brew "htop"
brew "nmap"
brew "m-cli"
brew "bash-completion"
brew "nvim"
brew "bash-git-prompt"
brew "awscli"
brew "gnupg"
# brew "postgis" # not needed while using db from docker
brew "postgresql" # still needed to give access to psql client outside docker
# brew "yarn"
brew "fd"
EOF
fancy_echo "Installing Homebrew CASK packages ..."
brew bundle --file=- <<EOF
# cask "gpg-suite"
# cask "iterm2"
# cask "fork"
# cask "atom"
# cask "google-chrome"
# cask "pgadmin4"
# cask "gimp"
# cask "skype"
# cask "disk-inventory-x"
# cask "docker"
# cask "slack"
# cask "android-studio"
# brew "homebank" # should be a cask but it is a brew
# cask "teamviewer"
# cask "vnc-viewer"
EOF
fancy_echo "preparing dotfiles..."
git clone https://github.com/formigarafa/dotfiles.git ~/.dotfiles
rcup -v
# install terminal font
fancy_echo "downloading terminal nerd-font..."
curl -o ~/Library/Fonts/SauceCodeProNerdFont-Regular.ttf https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/SourceCodePro/Regular/SauceCodeProNerdFont-Regular.ttf
# setting up tmux
fancy_echo "setting up tmux..."
git -C ~/.tmux/plugins/tpm pull || git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
~/.tmux/plugins/tpm/scripts/install_plugins.sh
fancy_echo "setting up vim..."
curl -fLo "${HOME}/.local/share/nvim/site/autoload/plug.vim" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugInstall +qall
fancy_echo "Setting up puma-dev"
sudo puma-dev -setup
puma-dev -install
# this might be required
# security add-trusted-cert -k login.keychain-db ~/Library/Application\ Support/io.puma.dev/cert.pem
# comment the following line on /etc/hosts to avoid issues with ipv6 and rails on puma-dev
# ::1 localhost
fancy_echo "Setting up asdf..."
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'
fancy_echo "A few adjustments on mac dock"
m dock prune
m dock magnification YES
m dock autohide YES
cat <<EOF
# Last touches
# setup of asgard scripts
git clone git@github.com:formigarafa/asgard_scripts.git ~/bin
cd ~/bin
git submodule init
git submodule update
cd ~/bin/aws-configuration
asdf install
bundle install
# ITerm2 settings (manual step):
# Open menu Iterm2 > Preferences
# Got to Tab Profiles > Text
# Select Font: "SauceCodePro Nerd Font Mono" and set size to 14
# keyboard setup
# open preferences keyboard
# set key repeat to fast
# set delay until repeat to short
# dock
# open prefereces > dock
# set size to 1/4
# set magnification to 1/2
# Disable "Show recent applications in Dock"
# caps-lock setup
# go to System Preferences --> Keyboard --> Modifier Keys
# set Caps Lock Key to "No Action"
# install xcode to be ready to go
EOF
##