Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·144 lines (125 loc) · 3.39 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·144 lines (125 loc) · 3.39 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
137
138
139
140
141
142
143
144
#!/usr/bin/env bash
set -euo pipefail
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="$(uname -s)"
echo "▶ Dotfiles bootstrap starting..."
# ----------------------------
# Detect OS and package manager
# ----------------------------
case "$OS" in
Linux)
if command -v zypper >/dev/null 2>&1; then
PM="zypper"
else
echo "✖ Unsupported Linux package manager (zypper required)"
exit 1
fi
;;
Darwin)
if command -v brew >/dev/null 2>&1; then
PM="brew"
else
echo "✖ Homebrew not found — install from https://brew.sh"
exit 1
fi
;;
*)
echo "✖ Unsupported OS: $OS"
exit 1
;;
esac
echo "▶ Using package manager: $PM"
# ----------------------------
# Sudo keep-alive (Linux only)
# ----------------------------
if [[ "$OS" == "Linux" ]]; then
echo "▶ Requesting sudo access"
sudo -v
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
done 2>/dev/null &
fi
# ----------------------------
# Install core packages
# ----------------------------
install_packages() {
case "$PM" in
zypper)
sudo wget https://mise.jdx.dev/rpm/mise.repo -O /etc/zypp/repos.d/mise.repo
sudo zypper refresh
sudo zypper install -y \
zsh starship fzf bat eza ripgrep zoxide git-core mise \
nodejs tmux yq
;;
brew)
brew install \
starship fzf bat eza ripgrep zoxide git mise \
node tmux yq gh
;;
esac
}
install_packages
# ----------------------------
# Create config dirs
# ----------------------------
echo "▶ Creating config directories"
mkdir -p ~/.config/{zsh,nvim,helix,starship}
# ----------------------------
# Zsh (ZDOTDIR-based layout)
# ----------------------------
bash "$DOTFILES_DIR/shell/install.sh"
# ----------------------------
# Set default shell (Linux only — macOS defaults to zsh)
# ----------------------------
if [[ "$OS" == "Linux" && "$SHELL" != *zsh ]]; then
echo "▶ Setting zsh as default shell"
chsh -s "$(command -v zsh)"
fi
# ----------------------------
# fzf keybindings (optional but good)
# ----------------------------
if [[ -d /usr/share/fzf ]]; then
echo "▶ Enabling fzf keybindings"
fi
# ----------------------------
# Workspace directory
# ----------------------------
echo "▶ Ensuring workspace directory exists"
mkdir -p "$HOME/workspace"
# ----------------------------
# Fonts
# ----------------------------
echo "▶ Installing Fonts"
bash "$DOTFILES_DIR/fonts/install.sh"
# ----------------------------
# Terminal (platform-specific)
# ----------------------------
if [[ "$OS" == "Linux" ]]; then
echo "▶ Installing Konsole Profile"
bash "$DOTFILES_DIR/konsole/install.sh"
elif [[ "$OS" == "Darwin" ]]; then
echo "▶ Installing Kitty Config"
bash "$DOTFILES_DIR/kitty/install.sh"
fi
# ----------------------------
# Git Config defaults
# ----------------------------
git config --global push.autoSetupRemote true
# ----------------------------
# Neovim (LazyVim)
# ----------------------------
echo "▶ Installing Neovim (LazyVim)"
bash "$DOTFILES_DIR/nvim/install.sh" --backup --native --yes
# ----------------------------
# AI Tooling
# ----------------------------
echo "▶ Installing AI Tooling"
bash "$DOTFILES_DIR/ai/install.sh"
# ----------------------------
# Final message
# ----------------------------
echo
echo "✔ Bootstrap complete"
echo "→ Restart your terminal or log out/in"