diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-26 14:47:01 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-26 14:47:01 -0500 |
| commit | f2dad229d23ca7f43d1b698a3fe3b11a994d4a3f (patch) | |
| tree | f95cf1cbb65738cb7ecef811f1caf43e33f3fe51 | |
| parent | 798b86faca84eaeba4f3f5ba1658b453603527de (diff) | |
| download | archsetup-f2dad229d23ca7f43d1b698a3fe3b11a994d4a3f.tar.gz archsetup-f2dad229d23ca7f43d1b698a3fe3b11a994d4a3f.zip | |
feat(archsetup): make the claude-code install optional
The claude-code step is a curl|sh from a third party, and not every user wants AI tooling. I put it behind INSTALL_CLAUDE_CODE (default yes, so current behavior is unchanged), with matching --claude-code / --no-claude-code flags. I wired it the same way as AUTOLOGIN and NO_GPU_DRIVERS: config mapping, a validate_config yes/no check, and a guard around the install block. I also documented the key in archsetup.conf.example.
| -rwxr-xr-x | archsetup | 31 | ||||
| -rw-r--r-- | archsetup.conf.example | 5 |
2 files changed, 32 insertions, 4 deletions
@@ -34,6 +34,7 @@ fresh_install=false show_status_only=false skip_gpu_drivers=false enable_autologin="" # empty=auto-detect, true=force enable, false=skip +install_claude_code=true # false to skip the claude-code native (curl|sh) install while [ $# -gt 0 ]; do case "$1" in @@ -66,6 +67,14 @@ while [ $# -gt 0 ]; do enable_autologin=false shift ;; + --claude-code) + install_claude_code=true + shift + ;; + --no-claude-code) + install_claude_code=false + shift + ;; --help|-h) echo "Usage: $0 [OPTIONS]" echo "" @@ -76,6 +85,8 @@ while [ $# -gt 0 ]; do echo " --no-gpu-drivers Skip GPU driver detection/installation" echo " --autologin Enable automatic console login" echo " --no-autologin Disable automatic console login" + echo " --claude-code Install the claude-code AI assistant (default)" + echo " --no-claude-code Skip the claude-code native (curl|sh) install" echo " --help, -h Show this help message" echo "" echo "See archsetup.conf.example for config file template." @@ -110,6 +121,8 @@ load_config() { [[ "$AUTOLOGIN" == "yes" ]] && enable_autologin=true [[ "$AUTOLOGIN" == "no" ]] && enable_autologin=false [[ "$NO_GPU_DRIVERS" == "yes" ]] && skip_gpu_drivers=true + [[ "$INSTALL_CLAUDE_CODE" == "yes" ]] && install_claude_code=true + [[ "$INSTALL_CLAUDE_CODE" == "no" ]] && install_claude_code=false # Repository overrides [[ -n "$DWM_REPO" ]] && dwm_repo="$DWM_REPO" @@ -171,6 +184,10 @@ validate_config() { echo "ERROR: NO_GPU_DRIVERS must be 'yes' or 'no'. Got: '$NO_GPU_DRIVERS'" >&2 exit 1 fi + if [[ -n "$INSTALL_CLAUDE_CODE" && "$INSTALL_CLAUDE_CODE" != "yes" && "$INSTALL_CLAUDE_CODE" != "no" ]]; then + echo "ERROR: INSTALL_CLAUDE_CODE must be 'yes' or 'no'. Got: '$INSTALL_CLAUDE_CODE'" >&2 + exit 1 + fi if [[ -n "$locale" && ! "$locale" =~ ^[a-z]{2,3}(_[A-Z]{2})?(\.[A-Za-z0-9-]+)?(@[A-Za-z]+)?$ ]]; then echo "ERROR: LOCALE looks malformed: '$locale'. Expected e.g. en_US.UTF-8" >&2 @@ -1994,10 +2011,16 @@ developer_workstation() { pacman_install npm # Node-js package manager aur_install nvm # Node-js version manager - # AI coding assistant (native install to ~/.local/bin) - action="installing claude-code via native installer" && display "task" "$action" - (sudo -u "$username" bash -c 'curl -fsSL https://claude.ai/install.sh | sh' >> "$logfile" 2>&1) || \ - error_warn "$action" "$?" + # AI coding assistant (native install to ~/.local/bin), opt-out via + # INSTALL_CLAUDE_CODE=no / --no-claude-code. Gated because it's curl|sh from + # a third party and not every user wants AI tooling. + if [ "$install_claude_code" = true ]; then + action="installing claude-code via native installer" && display "task" "$action" + (sudo -u "$username" bash -c 'curl -fsSL https://claude.ai/install.sh | sh' >> "$logfile" 2>&1) || \ + error_warn "$action" "$?" + else + display "task" "skipping claude-code install (INSTALL_CLAUDE_CODE=no)" + fi pacman_install inotify-tools # required by cross-agent-comms watcher (inotifywait) # HTML diff --git a/archsetup.conf.example b/archsetup.conf.example index f866134..962d05f 100644 --- a/archsetup.conf.example +++ b/archsetup.conf.example @@ -34,6 +34,11 @@ # Set to "yes" if you want to handle GPU drivers manually #NO_GPU_DRIVERS=no +# Install the claude-code AI assistant (default: yes) +# Native install via `curl -fsSL https://claude.ai/install.sh | sh`. +# Set to "no" to skip it (no AI tooling, avoids the curl-pipe-bash step). +#INSTALL_CLAUDE_CODE=yes + # System locale (default: prompt if not already configured) # Common options: en_US.UTF-8, en_GB.UTF-8, de_DE.UTF-8, es_ES.UTF-8, # fr_FR.UTF-8, pt_BR.UTF-8, ja_JP.UTF-8, zh_CN.UTF-8 |
