1
0
Fork 0

Add pacstall for neovim install + version updates on debian

Three changes:

1. NEW run_once_05-install-pacstall.sh.tmpl (debian-only)
   Installs pacstall via its official installer. Pacstall is an
   AUR-like package manager for debian/ubuntu, with neovim at
   0.12.2-1 (current as of bootstrap). The installer requires
   root and prompts for 'install axel?', so we run it under
   sudo with NON_INTERACTIVE=true and stdin redirected from /dev/null.

2. UPDATE run_once_20-install-user-packages.sh.tmpl
   On debian, prefer pacstall over the GitHub tarball when
   pacstall is available. The tarball fallback remains for the
   case where pacstall install failed or isn't wanted.

3. NEW dot_config/topgrade/topgrade.toml
   Topgrade's built-in pacstall step auto-detects pacstall and
   runs 'pacstall -U -Up' (update repo + upgrade packages).
   Built-in chezmoi step also auto-detects chezmoi. So our
   topgrade config just sets pre_sudo=true for password caching
   and ignore_failures for node.
This commit is contained in:
Rain 2026-06-21 20:43:38 -04:00
parent 6771aff6a6
commit b4a4b6e6b4
3 changed files with 116 additions and 32 deletions

View file

@ -62,41 +62,50 @@ if command -v fdfind >/dev/null 2>&1 && ! command -v fd >/dev/null 2>&1; then
ln -sf "$(command -v fdfind)" "$USER_HOME/.local/bin/fd"
fi
# Neovim — always install the latest official binary tarball on debian.
# apt's neovim is too old for LazyVim on stable (bookworm), and even on
# trixie we want a known-good version. Detect arch for the right tarball.
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) NVIM_TARBALL="nvim-linux64.tar.gz" ;;
aarch64|arm64) NVIM_TARBALL="nvim-linux-arm64.tar.gz" ;;
*)
die "unsupported arch for neovim tarball: $ARCH"
;;
esac
if command -v nvim >/dev/null 2>&1; then
NVIM_VER="$(nvim --version | head -1 | awk '{print $2}' | tr -d 'v')"
NVIM_MAJOR="$(echo "$NVIM_VER" | cut -d. -f1)"
NVIM_MINOR="$(echo "$NVIM_VER" | cut -d. -f2)"
if [[ "${NVIM_MAJOR:-0}" -lt 1 || ("$NVIM_MAJOR" -eq 0 && "${NVIM_MINOR:-0}" -lt 9) ]]; then
log "installed neovim $NVIM_VER too old — replacing with latest from GitHub ($ARCH)"
sudo apt-get remove -y neovim || true
# Neovim — install via pacstall on debian (auto-updated by topgrade via
# built-in pacstall step). Falls back to GitHub tarball if pacstall isn't
# available for some reason.
if command -v pacstall >/dev/null 2>&1; then
if ! command -v nvim >/dev/null 2>&1; then
log "installing neovim via pacstall"
sudo pacstall -I neovim
else
log "neovim $NVIM_VER from apt is recent enough — keeping it"
NVIM_TARBALL=""
log "neovim already installed: $(nvim --version | head -1)"
fi
fi
else
log "pacstall not installed — falling back to GitHub tarball"
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) NVIM_TARBALL="nvim-linux64.tar.gz" ;;
aarch64|arm64) NVIM_TARBALL="nvim-linux-arm64.tar.gz" ;;
*)
die "unsupported arch for neovim tarball: $ARCH"
;;
esac
if [[ -n "$NVIM_TARBALL" ]]; then
log "downloading neovim from GitHub ($NVIM_TARBALL)"
cd /tmp
NVIM_LATEST="$(curl -fsSL https://api.github.com/repos/neovim/neovim/releases/latest | grep tag_name | cut -d'"' -f4)"
curl -fL "https://github.com/neovim/neovim/releases/download/${NVIM_LATEST}/${NVIM_TARBALL}" -o nvim.tar.gz
sudo rm -rf /opt/nvim-linux* /usr/local/bin/nvim
sudo tar -xzf nvim.tar.gz -C /opt/
# The arm64 tarball extracts to nvim-linux-arm64, x86_64 to nvim-linux64.
sudo ln -sf "/opt/$(basename nvim.tar.gz .tar.gz)/bin/nvim" /usr/local/bin/nvim
rm -f nvim.tar.gz
if command -v nvim >/dev/null 2>&1; then
NVIM_VER="$(nvim --version | head -1 | awk '{print $2}' | tr -d 'v')"
NVIM_MAJOR="$(echo "$NVIM_VER" | cut -d. -f1)"
NVIM_MINOR="$(echo "$NVIM_VER" | cut -d. -f2)"
if [[ "${NVIM_MAJOR:-0}" -lt 1 || ("$NVIM_MAJOR" -eq 0 && "${NVIM_MINOR:-0}" -lt 9) ]]; then
log "installed neovim $NVIM_VER too old — replacing with latest from GitHub ($ARCH)"
sudo apt-get remove -y neovim || true
else
log "neovim $NVIM_VER from apt is recent enough — keeping it"
NVIM_TARBALL=""
fi
fi
if [[ -n "$NVIM_TARBALL" ]]; then
log "downloading neovim from GitHub ($NVIM_TARBALL)"
cd /tmp
NVIM_LATEST="$(curl -fsSL https://api.github.com/repos/neovim/neovim/releases/latest | grep tag_name | cut -d'"' -f4)"
curl -fL "https://github.com/neovim/neovim/releases/download/${NVIM_LATEST}/${NVIM_TARBALL}" -o nvim.tar.gz
sudo rm -rf /opt/nvim-linux* /usr/local/bin/nvim
sudo tar -xzf nvim.tar.gz -C /opt/
sudo ln -sf "/opt/$(basename nvim.tar.gz .tar.gz)/bin/nvim" /usr/local/bin/nvim
rm -f nvim.tar.gz
fi
fi
# Verify neovim is reachable (PATH may need /usr/local/bin explicitly for this run)