-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·150 lines (122 loc) · 4.97 KB
/
setup.sh
File metadata and controls
executable file
·150 lines (122 loc) · 4.97 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/bash
# Echoing each step
echo "Starting setup..."
# Check for and install Homebrew
if ! command -v brew &> /dev/null
then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Homebrew already installed. Skipping..."
fi
# Install Hack Nerd Font
echo "Installing Hack Nerd Font..."
FONT_DIR="$HOME/Library/Fonts"
curl -L https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/Hack.zip -o "$FONT_DIR/Hack.zip"
unzip -o "$FONT_DIR/Hack.zip" -d "$FONT_DIR"
rm "$FONT_DIR/Hack.zip"
# Update Homebrew and install packages
echo "Updating Homebrew and installing packages..."
brew update
brew install yarn npm nvim rbenv tree the_silver_searcher fzf z python nvm openssl@1.1 libpq ripgrep fd tmuxinator
$(brew --prefix)/opt/fzf/install # Install shell extensions for fzf
# Disable Apple Music because yuck
echo "Disabling Apple Music..."
brew install --cask notunes
# Copy .zshrc, .zshenv, and init.lua from your dotfiles repository
echo "Configuring zsh..."
for file in .zshrc .zshenv; do
if [ -f "${HOME}/${file}" ]; then
echo "Found existing ${file}, moving to ${file}.old"
mv "${HOME}/${file}" "${HOME}/${file}.old"
fi
cp "./${file}" "${HOME}/${file}"
done
echo "Installing Karabiner-Elements..."
brew install --cask karabiner-elements
KARABINER_CONFIG_DIR="${HOME}/.config/karabiner"
KARABINER_CONFIG_FILE="${KARABINER_CONFIG_DIR}/karabiner.json"
mkdir -p "${KARABINER_CONFIG_DIR}"
# Check if Karabiner config file exists
if [ ! -f "${KARABINER_CONFIG_FILE}" ]; then
echo "Karabiner-Elements config not found. Creating a default config file..."
# Create a new default config file if it doesn't exist
cp "./karabiner/karabiner.json" "${KARABINER_CONFIG_FILE}"
else
echo "Karabiner-Elements config found, moving to karabiner.json.old"
mv "${KARABINER_CONFIG_FILE}" "${KARABINER_CONFIG_FILE}.old"
cp "./karabiner/karabiner.json" "${KARABINER_CONFIG_FILE}"
fi
echo "Karabiner-Elements setup complete."
echo "Configuring NVM & installing LTS Node..."
mkdir -p "${HOME}/.nvm"
nvm install --lts
echo "Installing Rosetta 2..."
softwareupdate --install-rosetta --agree-to-license
# Install global npm packages
echo "Installing eslint globally..."
npm install -g eslint
if [ -d "${HOME}/.config/nvim" ]; then
echo "Found existing nvim directory, moving to nvim.old"
mv "${HOME}/.config/nvim" "${HOME}/.config/nvim.old"
fi
cp -r "./nvim" "${HOME}/.config/nvim"
echo "Configuring nvim..."
echo "-- Creating virtual environment for nvim's python dependencies..."
/opt/homebrew/bin/python3 -m venv "${HOME}/.config/nvim/env"
echo "-- Installing ruby for nvim..."
gem install neovim
echo "-- Installing npm for nvim..."
npm install -g neovim
echo "-- Installing pynvim..."
~/.config/nvim/env/bin/pip3 install pynvim
# Install things needed for nvim plugins....
brew install pngpaste
brew install luarocks
brew install go
brew install mactex
brew install beautysh
brew install fzf
brew install chafa
brew install viu
brew install jstkdng/programs/ueberzugpp
brew install perl
echo "Be sure to run `cpan` to setup perl environment!"
cpan Neovim::Ext # this might not work, sorry future-me! :D
echo "Installing Rails environment..."
gem install bundler
# install all latest stable versions of ruby from rbenv install -l
LATEST_RUBY_VERSION=$(rbenv install -l | grep -v - | tail -1)
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)" rbenv install $LATEST_RUBY_VERSION
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)" rbenv install 3.3.0
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)" rbenv install 3.2.3
rbenv global 3.3.0
gem install bundler
# Postgres GUI
echo "Installing Postgres GUI..."
brew install --cask pgadmin4
# install rust
echo "Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Configure tmuxinator
echo "Adding tmuxinator templates..."
if [ -d "${HOME}/.config/tmuxinator" ]; then
echo "Found existing tmuxinator directory, moving to ~/.config/tmuxinator.old"
mv "${HOME}/.config/tmuxinator" "${HOME}/.config/tmuxinator.old"
fi
cp -r "./tmuxinator" "${HOME}/.config/tmuxinator"
if [ -d "${HOME}/.tmux.conf" ]; then
echo "Found existing tmuxinator config file, moving to ~/.tmux.conf.old"
mv "${HOME}/.config/tmuxinator" "${HOME}/.tmux.conf.old"
fi
cp "./.tmux.conf" "${HOME}/.tmux.conf"
echo "Setup complete\!"
echo " "
echo "Be sure to configure iTerm2:"
echo "\u2022 Appearance settings"
echo " \u2514\u2500 Windows: enable 'Hide scrollbars'"
echo " \u2514\u2500 Tabs: enable 'Preserve window size when tab bar shows or hides' and 'Support basic HTML tags in tab titles'"
echo " \u2514\u2500 Dimming: change dimming amount to 15 and enable 'Dim only text, not background'"
echo "\u2022 Profile settings"
echo " \u2514\u2500 Colors: select 'Solarized Dark' in color presets"
echo " \u2514\u2500 Text: use the Hack Nerd Font with regular weight, 13pt, letter spacing 100, line spacing 101 and enable 'Use ligatures'"