Conversation
Add multi-platform support for NVIDIA DGX OS (Ubuntu-based): - Add OS branching to package installation script (Homebrew for macOS, apt for Linux) - Add macOS guard to iTerm2 shell integration script - Exclude macOS-only configs (Karabiner, iTerm2) on Linux via .chezmoiignore Linux package installation includes: - Core tools via apt (git, tmux, fish, fzf, ripgrep, etc.) - Tools from GitHub releases (starship, eza, age, delta, direnv, asdf) - Nerd Fonts for desktop usage Closes #58 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughThis pull request extends dotfiles configuration for cross-platform support. Changes add OS-level branching using the CHEZMOI_OS environment variable to conditionally apply macOS-specific settings on Linux/WSL environments. Updates include file exclusions, shell integration checks, and comprehensive package manager selection based on operating system. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.chezmoiscripts/run_once_after_install-item2-fish-shell-integration.sh (1)
9-10: LGTM! Proper shell integration installation.The directory creation and download logic are correct, with appropriate quoting and HTTPS usage.
Minor note: The script filename contains a typo ("item2" instead of "iterm2"), though this doesn't affect functionality.
.chezmoiscripts/run_once_before_install-minimum-packages.sh (1)
30-45: LGTM! Appropriate use of official installers with good fallback logic.The starship installation via official installer and eza's graceful fallback to the community repository are well-implemented. The GPG key verification for the eza repository adds good security hygiene.
Security note: Piping curl output to shell (line 32) is a common pattern for installer scripts but does carry inherent trust assumptions. This is acceptable for dotfiles installation from trusted sources.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.chezmoiignore(1 hunks).chezmoiscripts/run_once_after_install-item2-fish-shell-integration.sh(1 hunks).chezmoiscripts/run_once_before_install-minimum-packages.sh(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/.chezmoiscripts/**
📄 CodeRabbit inference engine (CLAUDE.md)
Use environment variables or runtime detection in shell scripts (
.chezmoiscripts/) and config files instead of Go Templates
Files:
.chezmoiscripts/run_once_before_install-minimum-packages.sh.chezmoiscripts/run_once_after_install-item2-fish-shell-integration.sh
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: toku345/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T15:38:35.953Z
Learning: Applies to **/.chezmoiscripts/** : Use environment variables or runtime detection in shell scripts (`.chezmoiscripts/`) and config files instead of Go Templates
📚 Learning: 2025-11-29T15:38:35.953Z
Learnt from: CR
Repo: toku345/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T15:38:35.953Z
Learning: Applies to **/.chezmoiscripts/** : Use environment variables or runtime detection in shell scripts (`.chezmoiscripts/`) and config files instead of Go Templates
Applied to files:
.chezmoiignore.chezmoiscripts/run_once_before_install-minimum-packages.sh
🔇 Additional comments (8)
.chezmoiignore (1)
8-13: LGTM! Clean OS-aware exclusion logic.The conditional exclusion correctly prevents macOS-only configurations from being applied on Linux systems. The use of Go templates is appropriate here since
.chezmoiignoreis processed by chezmoi's template engine..chezmoiscripts/run_once_after_install-item2-fish-shell-integration.sh (1)
3-7: LGTM! Correct use of environment variable for OS detection.The OS guard correctly uses the
CHEZMOI_OSenvironment variable for runtime detection, following the coding guidelines for.chezmoiscripts/files.Based on learnings, this approach is preferred over Go templates in shell scripts.
.chezmoiscripts/run_once_before_install-minimum-packages.sh (6)
3-10: LGTM! Clean macOS package installation.The Homebrew-based installation correctly uses the
CHEZMOI_OSenvironment variable and efficiently groups related package installations.Based on learnings, using environment variables for OS detection in shell scripts is the preferred approach.
11-14: LGTM! Comprehensive base package installation.The Linux base setup installs essential development and utility packages using standard apt-get practices.
16-28: LGTM! Excellent handling of Ubuntu package naming differences.The conditional symlink creation elegantly addresses Ubuntu's different package names (
batcatandfdfind) while maintaining consistent command names across platforms.
65-68: LGTM! Standard direnv installation.Uses the official installer with appropriate existence check.
70-74: LGTM! Correct asdf installation.Standard asdf installation using git clone with version pinning.
76-88: LGTM! Well-designed font installation with caching.The Nerd Fonts installation correctly checks for existing fonts to avoid redundant downloads and properly updates the font cache.
| # age (暗号化ツール) - 最新版を取得 | ||
| if ! command -v age >/dev/null 2>&1; then | ||
| sudo apt-get install -y age 2>/dev/null || { | ||
| AGE_VERSION=$(curl -sL https://api.github.com/repos/FiloSottile/age/releases/latest | grep '"tag_name"' | cut -d'"' -f4 | sed 's/^v//') | ||
| wget -qO /tmp/age.tar.gz "https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz" | ||
| sudo tar -xzf /tmp/age.tar.gz -C /usr/local/bin --strip-components=1 age/age age/age-keygen | ||
| rm /tmp/age.tar.gz | ||
| } | ||
| fi | ||
|
|
||
| # git-delta (GitHub Release) - 最新版を取得 | ||
| if ! command -v delta >/dev/null 2>&1; then | ||
| DELTA_VERSION=$(curl -sL https://api.github.com/repos/dandavison/delta/releases/latest | grep '"tag_name"' | cut -d'"' -f4) | ||
| wget -qO /tmp/delta.deb "https://github.com/dandavison/delta/releases/download/${DELTA_VERSION}/git-delta_${DELTA_VERSION}_amd64.deb" | ||
| sudo dpkg -i /tmp/delta.deb | ||
| rm /tmp/delta.deb | ||
| fi |
There was a problem hiding this comment.
Hardcoded architecture breaks ARM64 compatibility.
Lines 51 and 60 hardcode amd64 architecture, which will fail on ARM64 systems (increasingly common with Raspberry Pi, AWS Graviton, Apple Silicon Linux VMs, etc.).
Detect the system architecture dynamically:
- wget -qO /tmp/age.tar.gz "https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz"
+ ARCH=$(uname -m)
+ case "$ARCH" in
+ x86_64) ARCH="amd64" ;;
+ aarch64) ARCH="arm64" ;;
+ *) echo "Unsupported architecture: $ARCH"; exit 1 ;;
+ esac
+ wget -qO /tmp/age.tar.gz "https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-${ARCH}.tar.gz"Apply similar changes to the delta installation (line 60).
Additional considerations:
-
GitHub API rate limiting: Unauthenticated API calls (lines 50, 59, 72, 79) are limited to 60/hour per IP. In CI/CD or multiple runs, consider caching version numbers or using authenticated requests via
gh apiif available. -
Security: Downloaded binaries lack checksum or signature verification. For enhanced security in production use, verify release signatures or checksums published by the projects.
Committable suggestion skipped: line range outside the PR's diff.
Summary
Linux package installation includes:
Test plan
chezmoi applyCloses #58
🤖 Generated with Claude Code