forked from duncanmcclean/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
139 lines (103 loc) · 3.96 KB
/
install
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
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
# Oh My Zsh
echo "Installing Oh My Zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Oh My Zsh - Autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
# Oh My Zsh - Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
# Configure symlinks
rm ~/.zshrc
ln -s ~/.dotfiles/zsh/.zshrc ~/.zshrc
# Homebrew - Installation
echo "Installing Homebrew"
if test ! $(which brew); then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
eval "$(/opt/homebrew/bin/brew shellenv)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/duncan/.zprofile
# Update homebrew recipes
brew update
# Install Homebrew Packages
cd ~
echo "Installing Homebrew packages"
# Install packages from Brew
brew tap nicoverbruggen/homebrew-cask
brew tap 1password/tap
brew bundle --file=~/.dotfiles/Brewfile
# Install Composer
echo "Installing Composer"
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# Install Global Composer Packages
echo "Installing Global Composer Packages"
rm /Users/duncan/.composer/composer.json
ln -s /Users/duncan/.dotfiles/composer/composer.json /Users/duncan/.composer/composer.json
/usr/local/bin/composer global install
# Install Laravel Valet
echo "Installing Laravel Valet"
$HOME/.composer/vendor/bin/valet install
# Create Sites directory
echo "Creating a Sites directory"
mkdir $HOME/Sites
# Create Projects directory
echo "Creating a Projects directory"
mkdir $HOME/Projects
# Start MySQL for the first time
echo "Starting MySQL for the first time"
brew services start mysql
# Configure Laravel Valet
cd ~/Sites
valet park && cd ~
echo "Configuring Laravel Valet"
cd ~
valet restart
# Installing Global Node Dependecies
echo "Installing Global Node Dependecies"
npm install -g cross-env
npm install -g aicommits
# Generate SSH key
echo "Generating SSH keys"
ssh-keygen -t rsa
echo "Copied SSH key to clipboard - You can now add it to Github"
pbcopy < ~/.ssh/id_rsa.pub
# Register the Global Gitignore file
git config --global core.excludesfile $HOME/.dotfiles/git/.gitignore_global
# VS Code
open -a "Visual Studio Code"
sleep 5s
osascript -e 'quit app "Visual Studio Code"'
ln -s /Users/duncan/.dotfiles/code /Users/duncan/Library/Application\ Support/Code/User
# Symlinks
ln -s /Users/duncan/.dotfiles/git/.gitignore_global /Users/duncan/.gitignore_global
mkdir /Users/duncan/.hammerspoon
ln -s /Users/duncan/.dotfiles/hammerspoon/init.lua /Users/duncan/.hammerspoon/init.lua
ln -s /Users/duncan/.dotfiles/hammerspoon/Spoons /Users/duncan/.hammerspoon
# Finder: show file extensions & disable file extension warning
defaults write NSGlobalDomain AppleShowAllExtensions -bool false
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Don’t show recent applications in Dock
defaults write com.apple.dock show-recents -bool false
# Wipe everything from the Dock
defaults write com.apple.dock persistent-apps -array
# Hide 'Last Logged In' in terminal
touch .hushlogin
# Configure Git details
git config --global user.name "Duncan McClean"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main
git config --global --add --bool push.autoSetupRemote true
git config --global pull.rebase false
# Switch Git remote for dotfiles to SSH
git remote set-url origin [email protected]:duncanmcclean/dotfiles.git
# Complete
echo "Installation Complete"