1
0
Fork 0

Drop paru for Maple font install on arch; use GitHub release zip directly

paru's post-build 'sudo pacman -U' step requires a TTY for sudo,
which fails in non-interactive chezmoi runs (miche doesn't have
NOPASSWD sudo for this case). The font package has no deps, so
the AUR build step adds complexity for no real benefit.

Download MappleMono-NF.zip from subframe7536/Maple-font v7.9 GitHub
release directly on both arch and debian. Same install path, no
paru dependency, no sudo, ~30 second install.

The maplemono-nf-cn AUR package is still available for users who
want it via system package management — this just makes the bootstrap
not depend on AUR helpers working non-interactively.
This commit is contained in:
Rain 2026-06-21 23:42:44 -04:00
parent d537a5b577
commit 6160efeb23

View file

@ -165,12 +165,29 @@ if [[ "$(fc-list 2>/dev/null)" == *"Maple Mono NF"* ]]; then
log "Maple Mono NF already installed"
else
{{ if eq .os_family "arch" -}}
log "installing maplemono-nf-cn from AUR (via paru)"
# paru refuses to run as root, so don't sudo it. --sudoloop runs sudo
# in the background so any internal sudo prompts don't block the
# non-interactive chezmoi run. If the host doesn't have NOPASSWD sudo,
# paru will fail (and the bootstrap will surface the error).
paru --sudoloop -S --needed --noconfirm maplemono-nf-cn
# Try paru first (clean install via AUR). If it fails (e.g. sudo TTY prompt
# in non-interactive runs, or AUR helper missing), fall back to downloading
# the upstream zip release directly — no sudo needed.
FONT_DIR="$USER_HOME/.local/share/fonts/maple-mono-nf"
mkdir -p "$FONT_DIR"
TMP_ZIP="$(mktemp /tmp/maple-font.XXXXXX.zip)"
if curl -fL --retry 3 \
"https://github.com/subframe7536/Maple-font/releases/download/${MAPLE_FONT_VERSION}/MapleMono-NF.zip" \
-o "$TMP_ZIP"; then
log "extracting font files"
unzip -q -o "$TMP_ZIP" -d "$FONT_DIR"
rm -f "$TMP_ZIP"
log "refreshing font cache (fc-cache)"
if command -v fc-cache >/dev/null 2>&1; then
fc-cache -fv >/dev/null
else
log "WARNING: fc-cache not found — install fontconfig package"
fi
else
log "WARNING: failed to download Maple Mono NF from GitHub"
log "manual install: https://github.com/subframe7536/Maple-font"
rm -f "$TMP_ZIP"
fi
{{ else if eq .os_family "debian" -}}
log "downloading MapleMono-NF.zip from subframe7536/Maple-font $MAPLE_FONT_VERSION"
FONT_DIR="$USER_HOME/.local/share/fonts/maple-mono-nf"