From 6160efeb236d83b2ea4598b0d021e9ed5258820f Mon Sep 17 00:00:00 2001 From: rain Date: Sun, 21 Jun 2026 23:42:44 -0400 Subject: [PATCH] Drop paru for Maple font install on arch; use GitHub release zip directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- run_once_20-install-user-packages.sh.tmpl | 29 ++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/run_once_20-install-user-packages.sh.tmpl b/run_once_20-install-user-packages.sh.tmpl index 69236e7..cb823e3 100755 --- a/run_once_20-install-user-packages.sh.tmpl +++ b/run_once_20-install-user-packages.sh.tmpl @@ -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"