1
0
Fork 0
Commit graph

13 commits

Author SHA1 Message Date
5ce06f98de Fix neovim symlink target: was basename(tarball), now explicit NVIM_EXTRACT_DIR
The tarball filename is nvim-linux-arm64.tar.gz but the extracted
directory inside it is also named nvim-linux-arm64. However, my
original code did $(basename nvim.tar.gz .tar.gz) which returns 'nvim'
(strips both the directory and the suffix), creating a symlink to
/opt/nvim/bin/nvim that pointed to a non-existent path.

Discovered on rye after the bootstrap appeared to succeed but nvim
wasn't findable. Fixed by hardcoding the extracted directory name
based on the arch case:

  x86_64:   nvim-linux64.tar.gz  ->  nvim-linux64
  aarch64:  nvim-linux-arm64.tar.gz -> nvim-linux-arm64

Same fix applied to:
- run_once_20-install-user-packages.sh.tmpl (initial install)
- dot_local/bin/update-neovim.sh (topgrade-time updates)

Verified on rye: /usr/local/bin/nvim -> /opt/nvim-linux-arm64/bin/nvim,
'nvim --version' returns 'NVIM v0.11.4'.
2026-06-21 21:31:44 -04:00
a07596ebf7 Drop pacstall, use pinned binary tarball + topgrade update hook
Pacstall tried to BUILD neovim from source (downloaded the v0.12.2
tarball and ran the build chain). On a Pi this is 5+ minutes plus
fragile — pacstall's connection broke during download.

Switch to direct binary tarball install:

1. Pinned to NVIM_TARGET_VERSION='v0.11.4' in two places:
   - run_once_20-install-user-packages.sh.tmpl (initial install)
   - dot_local/bin/update-neovim.sh (topgrade-time updates)

2. Both use the same install logic: detect arch via uname -m, download
   the right tarball (nvim-linux-arm64.tar.gz for aarch64), extract
   to /opt, symlink /usr/local/bin/nvim. Idempotent — if installed
   version == target, no-op.

3. Topgrade config has a [commands] entry that runs the update script
   after system updates. To upgrade neovim across all boxes: edit
   NVIM_TARGET_VERSION in dot_local/bin/update-neovim.sh, commit,
   push, run topgrade.

4. Removed run_once_05-install-pacstall.sh.tmpl entirely — pacstall
   isn't worth the install footprint for one package.
2026-06-21 21:24:43 -04:00
3d972bd144 run_once_05: stop pre-installing pacstall deps, let installer handle them
The pacstall installer has its own dep install logic that handles edge
cases (e.g. debian-trixie dropped spdx-licenses from apt, so the
installer has a fallback to fetch the .deb directly from
ftp.debian.org and install via 'apt install /path/to/deb'). My script
was duplicating that logic with a strict apt-get install that failed
because spdx-licenses isn't in trixie apt.

Fix: install only the absolute minimum (curl, wget, ca-certificates,
sudo) so the installer can fetch and verify its own deps. Trust the
installer.
2026-06-21 20:58:00 -04:00
b4a4b6e6b4 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.
2026-06-21 20:43:38 -04:00
6771aff6a6 Fix run_once_20 neovim install for aarch64 + always-fallback
Two bugs hit on rye:

1. neovim tarball URL hardcoded to nvim-linux64.tar.gz (x86_64 only).
   On aarch64 boxes (rye is arm64), curl would 404 the tarball, the
   unpack would create a binary that won't run, or apt's bundled
   neovim might not even be installed.

2. The 'apt's neovim is too old' branch only ran if apt had
   successfully installed an old neovim. If apt didn't install
   neovim at all (or installed a recent enough version), the
   tarball fallback never triggered. On rye, the script reached
   the final 'nvim --version' verification line and crashed with
   'command not found'.

Fix:
- Detect arch via uname -m, map to correct tarball name
  (x86_64 -> nvim-linux64.tar.gz, aarch64 -> nvim-linux-arm64.tar.gz)
- If command -v nvim returns false at all, skip the version check
  entirely and go straight to the GitHub tarball
- If apt's neovim IS recent enough (>= 0.9), keep it and skip the
  tarball
- Final 'nvim --version' verification preceded by a PATH-ensure
  for /usr/local/bin in case the freshly-installed tarball binary
  isn't yet on PATH for this script's environment

Verified template renders cleanly on arch.
2026-06-21 20:29:09 -04:00
919afd26fd Guard run_once_10 with os_family conditional + sudo everywhere
Script claimed to be arch-only in its comment but had no actual guard.
The body always ran, so on debian it tried pacman-key (which doesn't
exist), failed with 'command not found', and aborted the whole bootstrap
chain (run_once_20 and run_onchange_30 never executed).

Fixes:
1. Wrap entire body in {{ if eq .os_family "arch" }} ... {{ end }} so
   the script is a no-op on debian (logs a skip message instead of dying)
2. Prepend sudo to pacman-key, pacman -U, pacman -Syu, pacman -S, and
   grep /etc/pacman.conf — same user-vs-root pattern that bit run_once_00
2026-06-21 20:17:39 -04:00
f8530c50f7 Fix run_once_00: prepend sudo to all package operations
chezmoi runs scripts as the invoking user, not root. run_once_00 was
calling apt-get/pacman directly, which fails on debian with
'Permission denied' on /var/lib/apt/lists/lock and on arch with
similar pacman lock errors. Same pattern was already correct in
run_once_20. Mirror that here.

This is the bug that blocked rye on the second attempt.
2026-06-21 19:46:54 -04:00
01eda7cd7f Drop id -u root check from run_once scripts
chezmoi runs run_once_* scripts as the invoking user (uid != 0).
The earlier check [[ $(id -u) -ne 0 ]] && die ... killed the script
immediately when invoked via 'chezmoi apply' or 'chezmoi init --apply'
from a normal user session.

The scripts use sudo internally for package operations (pacman/apt),
so elevation happens correctly. The id -u check was wrong: it belongs
in a script that's *meant* to be invoked as root directly, not in a
chezmoi-managed script.
2026-06-21 19:41:50 -04:00
0cc12f050a Fix .chezmoi.yaml.tmpl: handle missing ID_LIKE on debian-stable
debian-stable's /etc/os-release has no ID_LIKE field. Template crashed
with 'map has no entry for key idLike' when chezmoi init ran on rye.

Two fixes:
1. hasKey() guard around .chezmoi.osRelease.idLike so missing key
   doesn't error out
2. Flip contains() arg order: sprig's signature is contains(substr, str),
   not contains(str, substr). Was checking backwards.

Tested against:
- miche (ID=debian-derivative with ID_LIKE=arch) -> os_family=arch
- empty ID_LIKE fallback (debian-stable) -> falls through to .id=debian
  -> os_family=debian
2026-06-21 19:37:06 -04:00
ef9b7dcd2a README: use HTTPS URL for bootstrap clone
Anonymous read is enabled on the forge, so a freshly-installed box can
clone + init without needing SSH keys pre-configured. SSH stays as the
push URL on the main workstation.
2026-06-21 18:45:53 -04:00
c373014249 README: document bootstrap auto-installs Maple Mono NF font 2026-06-21 18:26:05 -04:00
e63ddca6ea Add Maple Mono NF font install to bootstrap
- Arch: paru -S maplemono-nf-cn (AUR package, installed via Chaotic-AUR)
- Debian: download MapleMono-NF.zip from subframe7536/Maple-font v7.9
  release, extract to ~/.local/share/fonts, run fc-cache
- Idempotent: skips if fc-list already shows Maple Mono NF
- Pinned to v7.9 (20.6MB); bump MAPLE_FONT_VERSION when upgrading

Also documented in README that the default Maple Mono NF in nvim
init.lua will Just Work on every box thanks to the bootstrap.
2026-06-21 18:25:21 -04:00
2f1477668b Initial chezmoi-managed dotfiles with bootstrap scripts
- Rename master to legacy-2025 on remote (frozen pre-chezmoi snapshot)
- New orphan 'main' branch with bootstrap-enabled config
- .chezmoi.yaml.tmpl detects os_family (debian | arch) from /etc/os-release
- dot_zshrc.tmpl refactored from current miche config with os_family
  conditional for pacman vs apt aliases
- dot_config/: bat, btop, ghostty (with gruvbox themes), kitty (with gruvbox
  colors), nvim (LazyVim), paru
- dot_gitconfig.tmpl, dot_tmux.conf (verbatim from current state)
- run_once_00-install-bootstrap-tools.sh.tmpl: age, git, curl, ca-certificates
- run_once_10-add-chaotic-aur.sh.tmpl (arch-only): add Chaotic-AUR + install paru
- run_once_20-install-user-packages.sh.tmpl: zsh, tmux, neovim (with version
  check + binary tarball fallback for debian), oh-my-zsh + plugins, tpm,
  rustup, all CLI tools
- run_onchange_30-ensure-cargo.sh.tmpl: rustup fallback
- README.md with onboarding runbook
2026-06-21 18:10:54 -04:00