-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_onchange_before_install-packages-linux.sh.tmpl
More file actions
executable file
·230 lines (197 loc) · 5.55 KB
/
run_onchange_before_install-packages-linux.sh.tmpl
File metadata and controls
executable file
·230 lines (197 loc) · 5.55 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#!/bin/bash
{{ if .machine.isLinux }}
set -euo pipefail
echo "Installing Linux packages..."
{{ if .machine.isArch }}
# Arch Linux with pacman
echo "Detected Arch Linux - using pacman..."
# Update package database
sudo pacman -Sy
# Install packages
sudo pacman -S --needed --noconfirm \
git curl wget \
zsh bash fish \
tmux zellij \
neovim vim \
base-devel \
python python-pip \
nodejs npm \
go rust \
ripgrep fd bat \
fzf eza \
htop btop \
ncdu tree \
jq yq \
docker \
kubectl helm \
terraform \
ansible \
aws-cli \
shellcheck \
asciinema \
redis \
openssh \
gnupg \
chezmoi
{{ if .machine.hasGui }}
# GUI applications (only if GUI is present)
echo "GUI detected - installing GUI applications..."
sudo pacman -S --needed --noconfirm \
firefox \
kitty \
alacritty
{{ end }}
echo "Arch Linux packages installed successfully!"
{{ else }}
# Debian/Ubuntu with apt
if command -v apt-get &>/dev/null; then
echo "Detected Debian/Ubuntu - using apt..."
# Update package database
sudo apt-get update
# Install core packages
echo "Installing core development tools..."
sudo apt-get install -y \
git git-lfs \
curl wget \
build-essential \
software-properties-common \
apt-transport-https \
ca-certificates \
gnupg \
lsb-release
# Install shells
echo "Installing shells..."
sudo apt-get install -y \
zsh bash fish
# Install terminal multiplexers
echo "Installing terminal tools..."
sudo apt-get install -y \
tmux
# Install editors
echo "Installing editors..."
sudo apt-get install -y \
neovim vim
# Install programming languages
echo "Installing programming languages..."
sudo apt-get install -y \
python3 python3-pip python3-venv \
nodejs npm \
golang-go \
lua5.4
# Install Rust via rustup (not from apt as it's often outdated)
if ! command -v rustc &>/dev/null; then
echo "Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi
# Install CLI utilities
echo "Installing CLI utilities..."
sudo apt-get install -y \
ripgrep fd-find bat \
fzf eza \
htop \
ncdu tree \
jq \
shellcheck \
asciinema \
openssh-client openssh-server \
mosh \
parallel \
telnet \
lynx
# Install chezmoi
if ! command -v chezmoi &>/dev/null; then
echo "Installing chezmoi..."
sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "$HOME/.local/bin"
fi
# Install Docker
if ! command -v docker &>/dev/null; then
echo "Installing Docker..."
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker "$USER"
fi
# Install kubectl
if ! command -v kubectl &>/dev/null; then
echo "Installing kubectl..."
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
fi
# Install Helm
if ! command -v helm &>/dev/null; then
echo "Installing Helm..."
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
fi
# Install Terraform
if ! command -v terraform &>/dev/null; then
echo "Installing Terraform..."
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update
sudo apt-get install -y terraform
fi
# Install Ansible
echo "Installing Ansible..."
sudo apt-get install -y ansible
# Install AWS CLI
if ! command -v aws &>/dev/null; then
echo "Installing AWS CLI..."
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install
rm -rf aws awscliv2.zip
fi
# Install starship prompt
if ! command -v starship &>/dev/null; then
echo "Installing Starship..."
curl -sS https://starship.rs/install.sh | sh -s -- -y
fi
# Install zoxide
if ! command -v zoxide &>/dev/null; then
echo "Installing zoxide..."
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
fi
{{ if .machine.hasGui }}
# GUI applications
echo "Installing GUI applications..."
sudo apt-get install -y \
firefox \
kitty
{{ end }}
echo "Debian/Ubuntu packages installed successfully!"
fi
# Fedora/RHEL with dnf
if command -v dnf &>/dev/null; then
echo "Detected Fedora/RHEL - using dnf..."
sudo dnf install -y \
git curl wget \
zsh bash fish \
tmux \
neovim vim \
gcc python3-pip \
nodejs npm \
golang rust cargo \
ripgrep fd-find bat \
fzf \
htop \
ncdu tree \
jq \
docker \
kubectl \
terraform \
ansible \
shellcheck \
asciinema \
redis \
openssh \
gnupg
{{ if .machine.hasGui }}
# GUI applications
sudo dnf install -y \
firefox \
kitty
{{ end }}
fi
{{ end }}
echo "Linux packages installed successfully!"
{{ end }}