-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·97 lines (80 loc) · 2.73 KB
/
install.sh
File metadata and controls
executable file
·97 lines (80 loc) · 2.73 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
#!/bin/bash
set -euo pipefail
cd ~
# Install dotfiles
# ================
DOTFILES_DIR="$HOME/dotfiles"
DOTFILES=(.gitconfig .gitignore_global .vimrc .zshrc .tmux.conf .config/starship.toml .config/containers/containers.conf .config/mako/config .config/gammastep/config.ini .local/share/com.pais.handy/settings_store.json)
# Symlink dotfiles to home directory
for file in "${DOTFILES[@]}"; do
# Create parent directory if needed (e.g., ~/.config for .config/starship.toml)
target_dir="$(dirname "$HOME/$file")"
if [ ! -d "$target_dir" ]; then
echo "Creating directory: $target_dir"
mkdir -p "$target_dir"
fi
if [ -L "$HOME/$file" ] && [ "$(readlink "$HOME/$file")" = "$DOTFILES_DIR/$file" ]; then
echo "$file is already symlinked correctly"
else
if [ -e "$HOME/$file" ] && [ ! -L "$HOME/$file" ]; then
echo "Backing up existing $file to $file.backup"
mv "$HOME/$file" "$HOME/$file.backup"
fi
echo "Creating symlink: $HOME/$file -> $DOTFILES_DIR/$file"
ln -sf "$DOTFILES_DIR/$file" "$HOME/$file"
fi
done
# Install binaries
# ================
if [ -f "$HOME/.use-binenv" ]; then
ARCH=$(uname -m)
BINENV_VERSION="0.21.1"
# Detect architecture
case $ARCH in
x86_64)
ARCH="amd64"
;;
aarch64|arm64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
mkdir -p ~/.local/bin
if ! command -v binenv &> /dev/null; then
echo "Installing binenv..."
(
cd "$(mktemp -d)"
curl -fsSL -O https://github.com/devops-works/binenv/releases/download/v${BINENV_VERSION}/binenv_linux_${ARCH}
curl -fsSL -O https://github.com/devops-works/binenv/releases/download/v${BINENV_VERSION}/checksums.txt
sha256sum --check --ignore-missing checksums.txt
mv binenv_linux_${ARCH} binenv
chmod +x binenv
./binenv update
./binenv install binenv
rm binenv
)
else
echo "binenv is already installed, skipping installation"
fi
~/.binenv/binenv install starship
# ~/.binenv/binenv install jq
~/.binenv/binenv install gh
~/.binenv/binenv install delta
~/.binenv/binenv install dust
else
echo "Skipping binenv installation (no ~/.use-binenv flag found)"
fi
# ~/.binenv/gh extension install mislav/gh-branch
# Run setup scripts
# ================
# Arch linux desktop setup
if command -v pacman &> /dev/null; then
~/dotfiles/scripts/arch-linux.sh
~/dotfiles/scripts/discord.sh
fi
if ! command -v claude &> /dev/null; then
curl -fsSL https://claude.ai/install.sh | bash
fi