-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·76 lines (70 loc) · 2.03 KB
/
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
#!/usr/bin/env zsh
ZSHRC_URL="https://raw.githubusercontent.com/looshch/configs/master/.zshrc"
# Declare CONFIGS with its value from zsh config.
eval "$(curl "${ZSHRC_URL}" --fail --silent --show-error --location 2>&1 | \
grep CONFIGS=)"
# Setup SSH.
ED="${HOME}/.ssh/ed"
ssh-keygen -q -t ed25519 -C "[email protected]" -f "${ED}" -P ""
ssh-add -q --apple-use-keychain "${ED}"
ssh-keyscan github.com >> "${HOME}/.ssh/known_hosts"
pbcopy < "${ED}.pub"
read -sk $'?paste into github.com/account/ssh\n'
# Install Homebrew first because it also installs Xcode command line tools
# which include Git which is needed for the configs repo.
BREW_URL="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
/bin/bash -c "$(curl -fsSL "${BREW_URL}")"
# Clone and setup the configs.
rm -rf "${CONFIGS}"
mkdir -p "${CONFIGS}"
git clone [email protected]:looshch/configs.git "${CONFIGS}"
ln -sf "${CONFIGS}/.zshrc" "${HOME}/.zshrc"
ln -sf "${CONFIGS}/.gitconfig" "${HOME}/.gitconfig"
ln -sf "${CONFIGS}/.sshconfig" "${HOME}/.ssh/config"
ln -sf "${CONFIGS}" "${HOME}/.config/karabiner"
CONFIG_NVIM="${HOME}/.config/nvim"
mkdir -p "${CONFIG_NVIM}"
ln -sf "${CONFIGS}/nvim.lua" "${CONFIG_NVIM}/init.lua"
ln -sf "${CONFIGS}/nvim.json" "${CONFIG_NVIM}/lazy-lock.json"
# Homebrew setup.
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="${PATH}:/opt/homebrew/bin"
chmod -R go-w '/opt/homebrew/share/zsh'
FPATH="$(brew --prefix)/share/zsh-completions:${FPATH}"
autoload -Uz compinit
compinit
rm -f ~/.zcompdump
compaudit | xargs chmod g-w
BREW_FORMULAE=(
zsh-completions
n
go
rbenv
fzf
ripgrep
fd
neovim
tree-sitter
docker
docker-compose
)
BREW_CASKS=(
iterm2
google-chrome
postman
telegram
gimp
font-ubuntu-mono-nerd-font
karabiner-elements
)
brew update
brew upgrade
brew install "${BREW_FORMULAE[@]}"
brew install --cask "${BREW_CASKS[@]}"
brew completions link
brew autoremove
brew untap homebrew/core
brew untap homebrew/cask
brew cleanup --prune=all
"$(brew --prefix)/opt/fzf/install"