Skip to content

Instantly share code, notes, and snippets.

@Tehnix
Last active December 7, 2023 18:55
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save Tehnix/3e4865fe2cbc6a572ed4 to your computer and use it in GitHub Desktop.
Save Tehnix/3e4865fe2cbc6a572ed4 to your computer and use it in GitHub Desktop.
Set up OS X with brew
#!/bin/sh
binaries=(
awscli
trash
tree
git
mosh
tmux
screen
zsh
go
pyenv
rbenv
ctags-exuberant
wget
npm
tldr
readline
xz
openssl
llvm
terminal-notifier
docker
yarn
nodenv
wemux
watchman
mas
asdf
zlib
bzip2
libiconv
curl
libzip
autoconf
bison
icu4c
libedit
libjpeg
libiconv
libpng
libxml2
openssl
re2c
tidy-html5
zlib
)
# Apps
apps=(
authy
battle-net
cyberduck
choosy
discord
dropbox
docker
drawio
font-hasklig
font-hack-nerd-font
font-hasklug-nerd-font
google-chrome
iterm2
keybase
mendeley-desktop
monodraw
protonmail-bridge
qlmarkdown
qlprettypatch
qlstephen
quicklook-json
spotify
steam
transmission
tableplus
vimr
homebrew/cask-versions/visual-studio-code-insiders
vlc
noisebuddy
authy
notion
paperspace
parsec
tip
)
# KakaoTalk, Slack and others are installed through the App Store.
export LC_CTYPE=en.US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PATH="/usr/local/bin:/usr/local/sbin:${PATH}"
# Make sure xcode command line tools are installed
xcode-select --install
echo ">>> installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Update homebrew recipes
brew update
echo ">>> installing common cli utils..."
# Install GNU core utilities (those that come with OS X are outdated)
brew install --force-bottle coreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install --force-bottle findutils
# Install Bash 4
brew install --force-bottle bash
# Install more recent versions of some OS X tools
brew install --force-bottle grep
echo ">>> installing binaries..."
brew install --force-bottle ${binaries[@]}
# Install scalafmt
#brew install --HEAD olafurpg/scalafmt/scalafmt
#scalafmt --version
open "https://github.com/kowainik/hit-on/releases"
brew cleanup
brew tap "homebrew/cask-fonts"
# Install apps via homebrew cask (we loop, because some might fail)
echo ">>> installing apps..."
for app in "${apps[@]}"
do
brew install --cask $app
done
# Install hasklig
echo ">>> installing the hasklig font..."
brew tap homebrew/cask-fonts
brew install --cask font-hasklig
# Install python versions
echo ">>> installing pyenv and python versions..."
eval "$(pyenv init -)"
CFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install 2.7.18
CFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install 3.10.0
pyenv rehash
pyenv global 2.7.18 3.10.0
# Setup node
eval "$(nodenv init -)"
nodenv install 20.2.0
nodenv rehash
nodenv global 20.2.0
# Setup ruby
rbenv install 3.2.1
# Install some python packages
pip install nvim
pip install flake8
pip3 install nvim
pip3 install flake8
# Install phpenv
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer \
| bash
export PHPENV_ROOT="${HOME}/.phpenv"
export PATH="${PHPENV_ROOT}/bin:${PATH}"
eval "$(phpenv init -)"
# sudo apt-get install libcurl4-gnutls-dev libonig-dev libtidy-dev libzip-dev
#export PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-bz2=$(brew --prefix bzip2) --with-curl=$(brew --prefix curl) --with-iconv=$(brew --prefix libiconv) --with-libedit=$(brew --prefix libedit) --with-tidy=$(brew --prefix tidy-html5)"
#PATH="$(brew --prefix icu4c)/bin:$(brew --prefix icu4c)/sbin:$(brew --prefix libiconv)/bin:$(brew --prefix curl)/bin:$(brew --prefix libxml2)/bin:$(brew --prefix bzip2)/bin:$(brew --prefix bison)/bin:$(brew --prefix tidy-html5)/bin:$PATH" \
# phpenv install 7.4.11
brew install php@7.4 composer # The above is broken on M1 ARM Macbooks for now.
# Install some NPM packages
npm install -g tldr
# Install neovim
echo ">>> installing neovim..."
brew install neovim
# Install stack
echo ">>> installing stack..."
curl -sSL https://get.haskellstack.org/ | sh
stack setup
# Install spacemacs
echo ">>> installing spacmacs and emacs-plus..."
git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
brew tap d12frosted/emacs-plus
brew install emacs-plus --HEAD --with-natural-title-bars
brew linkapps emacs-plus
brew cleanup
echo ">>> setting up dot files..."
# Clone down dot files
#mkdir -p ~/GitHub/Tehnix
#cd ~/GitHub/Tehnix
#git clone git@github.com:Tehnix/dot-files.git
#cd dot-files
#./link.sh
#echo ">>> opening links to apps that had no casks..."
#open https://developer.apple.com/safari/download/
# Apps that need to be installed from the App Store.
mas lucky Intacept
mas lucky Slack
mas lucky Magnet
#mas install 497799835 # Xcode 9.4.1
# Build local hoogle database
#stack hoogle
# Install rustup.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install the Go LSP.
go get -u github.com/sourcegraph/go-langserver
# Install the Python LSP.
pip install python-language-server
pip3 install python-language-server
# Get composer and install the PHP LSP.
#brew install homebrew/php/composer
#composer require felixfbecker/language-server
# Install spaceneovim (will require exiting nvim)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/tehnix/spaceneovim/master/install.sh)"
# Install some ruby packages (requires sudo, so will need interaction)
#sudo gem install rsense mdl
# Install oh-my-zsh
# NOTE: Do this last, since it will drop you into a zsh shell!
echo ">>> installing oh-my-zsh..."
ZSH="$HOME/.config/zsh/oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment