-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_once_install-linux-packages.sh.tmpl
More file actions
71 lines (57 loc) · 1.67 KB
/
run_once_install-linux-packages.sh.tmpl
File metadata and controls
71 lines (57 loc) · 1.67 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
#!/usr/bin/env bash
set -euo pipefail
log() { echo "[install] $*"; }
if [ -n "${CI:-}" ]; then
log "CI environment detected. Skipping system packages installation."
exit 0
fi
{{ if eq .chezmoi.os "linux" }}
log "Installing system packages and Go tools"
sudo apt update
# Utility tools
if ! command -v htop >/dev/null 2>&1; then
log "Installing utility tools..."
sudo apt install -y htop xclip
fi
# Install ripgrep for better grep performance (needed by Neovim)
if ! command -v rg >/dev/null 2>&1; then
log "Installing ripgrep..."
sudo apt install -y ripgrep
fi
if ! command -v go >/dev/null 2>&1; then
log "Installing Go..."
GO_VERSION="1.22.4"
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
rm go${GO_VERSION}.linux-amd64.tar.gz
if [ -d /usr/local/go/bin ]; then
export PATH="/usr/local/go/bin:$PATH"
fi
fi
if ! command -v tmux >/dev/null 2>&1; then
log "Installing tmux..."
sudo apt install -y tmux
fi
# Notification sound support for Claude Code hooks
if ! command -v paplay >/dev/null 2>&1; then
log "Installing pulseaudio-utils (paplay)..."
sudo apt install -y pulseaudio-utils
fi
if ! command -v go >/dev/null 2>&1; then
log "go command still not found; PATH is: $PATH"
exit 1
fi
# Go tools (after Go installation)
if ! command -v memo >/dev/null 2>&1; then
log "Installing memo..."
go install github.com/mattn/memo@latest
fi
if ! command -v ghq >/dev/null 2>&1; then
log "Installing ghq..."
go install github.com/x-motemen/ghq@latest
fi
if ! command -v glow >/dev/null 2>&1; then
log "Installing glow..."
go install github.com/charmbracelet/glow@latest
fi
{{ end }}