-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·136 lines (106 loc) · 3.52 KB
/
install.sh
File metadata and controls
executable file
·136 lines (106 loc) · 3.52 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
#!/bin/bash
set -eux
PREFIX="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Trust mise config files to prevent interactive prompts
if command -v mise >/dev/null 2>&1; then
mise trust /workspaces/mmwebsite 2>/dev/null || true
mise trust ~/.config/mise/config.toml 2>/dev/null || true
fi
FILES_TO_LINK=(bashrc vimrc tmux.conf zshrc vim/coc-settings.json inputrc profile bash_profile ssh/rc)
for FILE in "${FILES_TO_LINK[@]}"; do
FROM="$HOME/.$FILE"
rm -f "$FROM"
mkdir -p "$(dirname "$FROM")"
ln -sf "$PREFIX/$FILE" "$FROM"
done
WEZTERM="$HOME/.config/wezterm"
mkdir -p "$WEZTERM"
ln -sf $PREFIX/wezterm/wezterm.lua "$WEZTERM/wezterm.lua"
HAMMERSPOON="$HOME/.hammerspoon"
mkdir -p "$HAMMERSPOON"
ln -sf $PREFIX/hammerspoon/init.lua "$HAMMERSPOON/init.lua"
OHMYPOSH="$HOME/.config/oh-my-posh/themes"
mkdir -p "$OHMYPOSH"
ln -sf $PREFIX/oh-my-posh/themes/theme.omp.json "$OHMYPOSH/theme.omp.json"
mkdir -p "$HOME/local/bin"
mkdir -p "$HOME/.vimtmp"
nvim_conf_dir="$HOME/.config/nvim"
# Simplify after deployed to all environments
if [[ -d $nvim_conf_dir && ! -L $nvim_conf_dir ]]; then
unlink "$nvim_conf_dir/init.vim"
rmdir "$nvim_conf_dir"
elif [[ ! -L $nvim_conf_dir ]]; then
echo "$nvim_conf_dir should create symlink"
ln -sf $PREFIX/nvim "$nvim_conf_dir"
fi
# --- Install system packages ---
if [ "$(uname)" == "Darwin" ]; then
brew upgrade
brew install go
brew install jandedobbeleer/oh-my-posh/oh-my-posh
brew install --cask karabiner-elements
mkdir -p $PREFIX/.config/karabiner
ln -sf $PREFIX/karabiner/karabiner.json ~/.config/karabiner/karabiner.json
brew install tree
brew install tmux
brew install --cask font-jetbrains-mono-nerd-font
brew install bash
brew install bash-completion
brew install cpm
brew install openssl
brew install hashicorp/tap/hashicorp-vagrant
brew install git-lfs
./installer/xcode.sh
else
sudo apt-get update
sudo apt install -y unzip
sudo apt install -y pipx
cd /tmp || exit
curl -s https://ohmyposh.dev/install.sh | bash -s
sudo apt install -y tmux
sudo apt install -y python3-pyx
cd -
fi
# --- Run sub-installers before using the tools they provide ---
./installer/ubi.sh
./installer/nvim.sh
./installer/claude.sh
./configure/git.sh
# --- Set up tools that depend on the installers above ---
alias ls='ls --color=auto'
if command -v go >/dev/null 2>&1; then
go install mvdan.cc/sh/v3/cmd/shfmt@latest || true
fi
if command -v pipx >/dev/null 2>&1; then
pipx install vim-vint || true
fi
if command -v npm >/dev/null 2>&1; then
npm install -g @openai/codex || true
fi
# Install vim plugins (nvim is now available from installer/nvim.sh)
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
if command -v nvim >/dev/null 2>&1; then
nvim --headless +'PlugInstall --sync' +qa
nvim --headless +':GoUpdateBinaries' +qa || true # Allow failure if Go plugin not installed
fi
# --- tmux plugin management ---
LOCALCHECKOUT=~/.tmux/plugins/tpm
if [ ! -d $LOCALCHECKOUT ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
else
pushd $LOCALCHECKOUT >/dev/null
git pull origin master
popd >/dev/null
fi
# tmux needs to be running in order to source a config file etc
# automatically update plugins
tmux kill-session -t CI 2>/dev/null || true
tmux new-session -d -s CI
tmux ls
tmux source ~/.tmux.conf
~/.tmux/plugins/tpm/bin/install_plugins
~/.tmux/plugins/tpm/bin/update_plugins all
~/.tmux/plugins/tpm/bin/clean_plugins
tmux kill-session -t CI
echo "🏁 INSTALLER FINISHED"