Skip to content

Suppress interactive prompts in Homebrew installs - #72

Open
thompsonson wants to merge 2 commits into
mainfrom
feat/unattended-brew-install
Open

Suppress interactive prompts in Homebrew installs#72
thompsonson wants to merge 2 commits into
mainfrom
feat/unattended-brew-install

Conversation

@thompsonson

Copy link
Copy Markdown
Owner

Fixes unattended installation by adding Homebrew environment variables.

Changes

  • Add HOMEBREW_NO_INSTALL_CLEANUP=1 to skip post-install prompts
  • Add CI=true to enable unattended/non-interactive mode
  • Applied to:
    • Linux brew package function
    • macOS global scope (covers all direct brew calls)
    • macOS install progress function

Result

Chezmoi now runs completely unattended without confirmation dialogs or cleanup waits.

@thompsonson thompsonson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Overview

The PR's stated goal is narrow: add HOMEBREW_NO_INSTALL_CLEANUP=1 and CI=true to run_once_install-packages.sh.tmpl so chezmoi apply runs unattended. The actual diff touches two files, though, and roughly half the changes (all of dot_tmux.conf) are unrelated to that stated purpose.

⚠️ Scope mismatch (main concern)

dot_tmux.conf changes aren't mentioned anywhere in the PR title/body, but they're substantial:

  • default-terminal changed from screen-256colortmux-256color
  • The dracula/tmux plugin is removed and replaced with a ~35-line hand-rolled Nord-themed status bar
  • The "Remote Development Optimizations" section header is split to insert a new "Status Bar Configuration" section

None of this suppresses prompts or relates to Homebrew. Worth confirming this is intentional (e.g. a rebase artifact vs. deliberate bundling) — either split into two PRs, or update the description so reviewers aren't misled about scope. The tmux status bar itself looks functionally fine; it just deserves its own description. Minor cosmetic note: dot_zshrc still sets BAT_THEME="Dracula" for bat/fzf, so the color scheme is now inconsistent (Dracula in bat/fzf, Nord in tmux) — not a bug, just worth knowing.

run_once_install-packages.sh.tmpl

1. CI=true is exported unscoped for the rest of the script
Since this is one continuous bash process, export CI=true set inside install_brew_packages() / at the macOS global scope leaks into everything that runs afterward — pipx install, fnm/Node install, Docker setup, etc. Several CLI tools change behavior under CI (disabled prompts/color/progress), which is broader than "suppress Homebrew prompts." Consider scoping it directly to the brew calls instead:

CI=true HOMEBREW_NO_INSTALL_CLEANUP=1 brew install "$package"

or unset CI once the brew-related sections finish.

2. Redundant duplicate exports
On macOS the exports are set at global scope (:367-368) and again inside install_with_progress() (:378-379). Since it's a single script process, the inner re-export is redundant — pick one location.

3. Minor style
Extra trailing blank lines left after each inserted export block (e.g. :144, :368-370, :379-381) — inconsistent with surrounding spacing.

4. Test coverage
tests/test.sh explicitly excludes .tmpl files from shellcheck ("Go templates confuse shellcheck"), so nothing in CI validates this file's shell syntax — not a regression from this PR, just a reminder that chezmoi execute-template + --dry-run (per CLAUDE.md's package workflow) is the only safety net here.

Summary

  • Worth addressing: clarify or split out the unrelated tmux.conf changes.
  • Worth addressing: scope CI=true more tightly, drop the duplicate export in install_with_progress.
  • Nice to have: trim extra blank lines.

The core Homebrew env-var fix itself is small, correct, and uses legitimate documented Homebrew behavior — no security concerns there.


Generated by Claude Code

@thompsonson
thompsonson force-pushed the feat/unattended-brew-install branch from 300e275 to 7dfeffb Compare August 5, 2026 17:13
- Add HOMEBREW_NO_INSTALL_CLEANUP=1 to skip post-install prompts
- Add CI=true to enable unattended mode for all brew operations
- Apply to Linux brew function, macOS global scope, and macOS install function
- Ensures chezmoi runs completely unattended without confirmation dialogs
@thompsonson
thompsonson force-pushed the feat/unattended-brew-install branch from 7dfeffb to 9a22420 Compare August 5, 2026 17:15
@thompsonson

Copy link
Copy Markdown
Owner Author

Updated per review

Addressed all concerns from the code review:

Rebased onto origin/main — removed unrelated tmux changes that were inadvertently included

Scoped CI=true tightly — now only applied per-call as a prefix to brew commands:

  • CI=true brew install $package
  • CI=true brew upgrade $package
  • No longer exported globally, so it won't affect pipx, fnm, Node, or other tools

Removed redundant exports — kept global HOMEBREW_NO_INSTALL_CLEANUP=1 (safe, only affects cleanup timing) and removed duplicate exports from install_with_progress function

Cleaned up spacing — removed extra blank lines for consistency

Summary of final approach:

  • HOMEBREW_NO_INSTALL_CLEANUP=1 exported once globally (affects only Homebrew cleanup behavior)
  • CI=true applied per-invocation only to brew calls (suppresses Homebrew prompts without affecting other tools)

- nono: kernel-enforced capability sandbox for AI agents
- Available on macOS and Linux via lukehinds/nono tap
- Supports Landlock (Linux) and Seatbelt (macOS) security primitives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant