forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fresh.sh
executable file
·116 lines (87 loc) · 3.08 KB
/
fresh.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
#!/bin/sh
echo "Setting up your Mac..."
# Ask for the administrator password upfront
sudo -v
# install commandline tools
xcode-select --install
# install rosetta for mac m1
sudo softwareupdate --install-rosetta
# Keep-alive: update existing `sudo` time stamp until We have finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Add SSH Key to keychain
ssh-add -K
# Check for Oh My Zsh and install if we don't have it
if test ! $(which omz); then
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/HEAD/tools/install.sh)"
fi
# Check for Homebrew and install if we don't have it
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Update Homebrew recipes
brew update
# Install all our dependencies with bundle (See Brewfile)
brew tap homebrew/bundle
brew bundle
brew cleanup
# install zsh-nvm plugin
git clone https://github.com/lukechilds/zsh-nvm ~/.dotfiles/zsh/custom/plugins/zsh-nvm
# Removes .zshrc from $HOME (if it exists) and symlinks the .zshrc file from the .dotfiles
rm -rf $HOME/.zshrc
ln -s $HOME/.dotfiles/zsh/.zshrc $HOME/.zshrc
compaudit | xargs chmod g-w,o-w
zsh
source $HOME/.zshrc
# Install PHP extensions with PECL
sudo mkdir -p /opt/homebrew/lib/php/pecl/20200930 # Fixes pecl xdebug install error
pecl install xdebug
pecl install redis
# Install global Composer packages
composer global require laravel/valet
composer global require laravel/installer
composer global require laravel/vapor-cli --update-with-dependencies
# Install Laravel Valet
$HOME/.composer/vendor/bin/valet install
valet tld valet
valet trust
valet use [email protected]
cp configs/ext-xdebug.ini /opt/homebrew/etc/php/8.1/conf.d/ext-xdebug.ini
cp configs/ext-xdebug.ini /opt/homebrew/etc/php/8.0/conf.d/ext-xdebug.ini
cp configs/ext-xdebug.ini /opt/homebrew/etc/php/7.4/conf.d/ext-xdebug.ini
cp configs/ext-xdebug.ini /opt/homebrew/etc/php/7.3/conf.d/ext-xdebug.ini
# Install nvm
nvm install node
nvm install lts/gallium
nvm alias stable lts/gallium
nvm use stable
npm -g install @vue/cli netlify-cli alfred-packagist alfred-npms
arch -x86_64 zsh
nvm install lts/erbium
nvm install lts/carbon
nvm install lts/dubnium
nvm install lts/fermium
nvm use lts/carbon
npm -g install gulp
arch -arm64 zsh
nvm use stable
# Add npm packages to package.json when installing
npm config set save true
# Setup mysql
mysql_install_db
#mysql.server start
brew services start mariadb
sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '';"
# Symlink the Mackup config file to the home directory
rm -rf $HOME/.mackup.cfg
ln -s $HOME/.dotfiles/configs/.mackup.cfg $HOME/.mackup.cfg
# GIT
# Copy gitignore global
rm -rf $HOME/.gitignore_global
ln -s $HOME/.dotfiles/configs/.gitignore_global $HOME/.gitignore_global
git config --global init.defaultBranch main
#configure QLStephen
sudo run xattr -cr ~/Library/QuickLook/QLStephen.qlgenerator
sudo run qlmanage -r
sudo run qlmanage -r cache