Distribution-agnostic provisioning script that sets up a new Linux machine (Detected via lib/distro.sh - supports Debian/Ubuntu/Pop and Fedora families). 13 stages covering: - System packages, external repos, toolchains (nvm, uv, Python) - Shell config (zsh, oh-my-zsh, p10k), git, SSH - Custom uv tools from ~40 git repos - Desktop config (keybindings, hotkeys, ghostty, fonts) - Docker, system tweaks, browser/app installs - Custom systemd user services (porridge, swayidle, mempi-sync, etc.) - API keys loaded from Bitwarden at shell startup
38 lines
1.4 KiB
Bash
38 lines
1.4 KiB
Bash
#!/usr/bin/env bash
|
|
# ===========================================================================
|
|
# Stage 11: System Tweaks
|
|
# sysctl tuning, kernel cmdline parameters, TLP/powertop, modprobe.
|
|
# Uses distro-agnostic variables from lib/distro.sh.
|
|
# ===========================================================================
|
|
# CAUTION: GPU kernel parameters are hardware-specific (AMD Radeon 680M).
|
|
# They are COMMENTED OUT by default. Uncomment only if you have the same GPU.
|
|
# ===========================================================================
|
|
|
|
CONFIG_DIR="${SCRIPT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}/config"
|
|
|
|
# ===========================================================================
|
|
# 1. TLP / PowerTOP
|
|
# ===========================================================================
|
|
info "Configuring power management..."
|
|
|
|
$SERVICE_ENABLE tlp 2>/dev/null && ok "TLP enabled." || warn "TLP not available."
|
|
|
|
if command -v powertop &>/dev/null; then
|
|
# Enable powertop auto-tune via systemd service
|
|
if [ ! -f /etc/systemd/system/powertop.service ]; then
|
|
sudo tee /etc/systemd/system/powertop.service > /dev/null << 'EOF'
|
|
[Unit]
|
|
Description=PowerTOP auto tune
|
|
[Service]
|
|
Type=oneshot
|
|
ExecStart=/usr/sbin/powertop --auto-tune
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
sudo systemctl daemon-reload
|
|
fi
|
|
$SERVICE_ENABLE powertop 2>/dev/null && ok "PowerTOP auto-tune enabled." || true
|
|
fi
|
|
|
|
ok "Stage 11 complete: system tweaks applied."
|