-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-linux.sh
More file actions
executable file
·157 lines (133 loc) · 4.09 KB
/
install-linux.sh
File metadata and controls
executable file
·157 lines (133 loc) · 4.09 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
#!/bin/bash
# Linux package installer - installs CLI tools via apt and mise/cargo
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
info() { echo -e "${GREEN}[INFO]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }
# Check we're on Linux
if [ "$(uname -s)" != "Linux" ]; then
error "This script is for Linux only"
fi
# Check for sudo
if ! command -v sudo &> /dev/null; then
error "sudo is required"
fi
CONFIGS_DIR="$(cd "$(dirname "$0")" && pwd)"
# ============================================
# Step 1: Add mise apt repository
# ============================================
info "Adding mise apt repository..."
sudo apt-get update -qq
sudo apt-get install -y -qq gpg curl
sudo install -dm 755 /etc/apt/keyrings
curl -fsSL https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list > /dev/null
# ============================================
# Step 2: Update and install apt packages
# ============================================
info "Updating apt cache..."
sudo apt-get update -qq
APT_PACKAGES=(
# Core tools
git
tmux
zsh
fzf
ripgrep
fd-find
bat
jq
neovim
vim
# Modern CLI tools
eza
zoxide
btop
duf
git-delta
just
hyperfine
# Git tools
tig
gh
# Shell
zsh-syntax-highlighting
# Utilities
trash-cli
xclip
xsel
curl
wget
unzip
build-essential
# mise (from mise repo)
mise
)
info "Installing apt packages..."
sudo apt-get install -y "${APT_PACKAGES[@]}"
# ============================================
# Step 3: Fix fd/bat binary names (Ubuntu uses different names)
# ============================================
# Ubuntu installs fd as 'fdfind' and bat as 'batcat'
if command -v fdfind &> /dev/null && ! command -v fd &> /dev/null; then
info "Creating fd symlink (Ubuntu uses fdfind)..."
sudo ln -sf "$(which fdfind)" /usr/local/bin/fd
fi
if command -v batcat &> /dev/null && ! command -v bat &> /dev/null; then
info "Creating bat symlink (Ubuntu uses batcat)..."
sudo ln -sf "$(which batcat)" /usr/local/bin/bat
fi
# ============================================
# Step 4: Symlink Linux mise config
# ============================================
info "Setting up Linux mise config..."
MISE_DIR="$HOME/.config/mise"
mkdir -p "$MISE_DIR"
# Symlink linux-mise-tools.toml as config.local.toml
if [ -L "$MISE_DIR/config.local.toml" ]; then
rm "$MISE_DIR/config.local.toml"
elif [ -f "$MISE_DIR/config.local.toml" ]; then
mv "$MISE_DIR/config.local.toml" "$MISE_DIR/config.local.toml.backup.$(date +%Y%m%d_%H%M%S)"
fi
ln -s "$CONFIGS_DIR/linux-mise-tools.toml" "$MISE_DIR/config.local.toml"
info "Symlinked: $MISE_DIR/config.local.toml → $CONFIGS_DIR/linux-mise-tools.toml"
# Trust, install, and activate globally
eval "$(mise activate bash)"
mise trust "$MISE_DIR"
info "Installing and activating tools globally..."
mise install
mise use --global --file "$CONFIGS_DIR/linux-mise-tools.toml"
# ============================================
# Step 5: Change default shell to zsh
# ============================================
if [ "$SHELL" != "$(which zsh)" ]; then
info "Changing default shell to zsh..."
chsh -s "$(which zsh)"
fi
# ============================================
# Step 6: Install Claude Code
# ============================================
info "Installing Claude Code..."
curl -fsSL https://claude.ai/install.sh | bash
# ============================================
# Done!
# ============================================
echo ""
info "Linux package installation complete!"
echo ""
echo "Installed via apt:"
echo " ${APT_PACKAGES[*]}" | fold -s -w 70 | sed 's/^/ /'
echo ""
echo "Installed via mise/cargo:"
echo " lazygit, starship, atuin, procs, du-dust, tokei"
echo ""
echo "Next steps:"
echo " 1. Run ./install.sh to set up symlinks"
echo " 2. Log out and back in (or run: exec zsh)"
echo " 3. Run: mise trust ~/.config/mise/config.toml"
echo ""