-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmin-setup-via-curl.sh
More file actions
75 lines (63 loc) · 2.46 KB
/
min-setup-via-curl.sh
File metadata and controls
75 lines (63 loc) · 2.46 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
#!/usr/bin/env bash
set -euo pipefail
# Minimal nice setup for Debian/Ubuntu
# curl-bash friendly, non-interactive, idempotent
# Meant to be used on distant hosts, new machines and containers, including dev containers
# All file downloads use cache-busted URLs to ensure fresh content is always fetched from GitHub
# Usage: curl -fsSL "https://raw.githubusercontent.com/paps/dotfiles/refs/heads/master/min-setup-via-curl.sh?$(date +%s)" | bash
export DEBIAN_FRONTEND=noninteractive
echo "Updating package lists..."
echo "/////////////////////////"
sudo apt-get update
echo ""
echo "==> Installing packages..."
echo "//////////////////////////"
sudo apt-get install -y zsh htop neovim git ripgrep tree tmux mosh
echo ""
echo "==> Downloading ~/.tmux.conf..."
echo "///////////////////////////////"
curl -fsSL "https://raw.githubusercontent.com/paps/dotfiles/refs/heads/master/tmux/tmux.conf?$(date +%s)" -o ~/.tmux.conf
echo ""
echo "==> Setting up git aliases..."
echo "/////////////////////////////"
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
echo ""
echo "==> Downloading ~/.zshrc..."
echo "///////////////////////////"
curl -fsSL "https://raw.githubusercontent.com/paps/dotfiles/refs/heads/master/zsh/zshrc?$(date +%s)" -o ~/.zshrc
echo ""
# Set zsh as default shell for current user
CURRENT_SHELL=$(getent passwd "$(whoami)" | cut -d: -f7)
ZSH_PATH=$(command -v zsh)
if [ "$CURRENT_SHELL" != "$ZSH_PATH" ]; then
echo "==> Setting zsh as default shell..."
echo "///////////////////////////////////"
sudo usermod -s "$ZSH_PATH" "$(whoami)"
else
echo "==> zsh is already the default shell."
echo "/////////////////////////////////////"
fi
echo ""
echo "==> Downloading ~/.config/nvim/init.lua..."
echo "//////////////////////////////////////////"
mkdir -p ~/.config/nvim
curl -fsSL "https://raw.githubusercontent.com/paps/dotfiles/refs/heads/master/nvim/init.lua?$(date +%s)" -o ~/.config/nvim/init.lua
# Tailscale hints
echo ""
if ! command -v tailscale &>/dev/null; then
echo "==> Tailscale is not installed. To install:"
echo " curl -fsSL https://tailscale.com/install.sh | sh"
elif ! tailscale status &>/dev/null; then
echo "==> Tailscale is installed but not running. To enable and give SSH access:"
echo " sudo tailscale up --ssh"
else
echo "==> Tailscale is running (nice!). IP:"
tailscale ip
echo ""
echo "==> Tailscale status:"
tailscale status
fi
echo ""
echo "==> Done :)"