Make assimilate.sh cross-platform (macOS + Linux)#12
Open
akan72 wants to merge 12 commits into
Open
Conversation
Branches on `uname -s` to skip macOS-only steps on Linux: - Skip hammerspoon/ghostty/vscode/zed symlinks and `brew bundle install` - Source dotfiles bashrc from $HOME/.bashrc instead of symlinking (the EC2 user_data appends a secrets block; symlinking would write into the repo) - Pick delta tarball + SHA256 per OS/arch (Linux SHA marked TODO until first install on the EC2 box) - Only run `nvim PackerSync` if nvim is on PATH Enables running the install script on the EC2 dev box without breaking the existing macOS flow.
lsd isn't installed on the EC2 dev box (no brew, dnf doesn't ship it), and the dotfiles flow doesn't have a good place to install it cross-platform without dragging in a several-minute cargo compile. Plain ls is fine.
Matches the same pattern nvm uses two lines above. Sourcing an absent file errors out on shell startup, which is harmless on Mac (rust is installed) but breaks the prompt on systems without rust.
AL2023 (and likely most non-Fedora Linuxes) don't have neovim in the default package repos. macOS gets it from the Brewfile. Drops nvim into $HOME/.local/bin so no root is needed. Placed above the PackerSync block so the plugin sync that depends on `command -v nvim` actually fires.
v0.10.4 (my earlier guess) doesn't exist as a published release. v0.9.5 is what's installed on the Mac, and v0.9.x predates the asset-rename (still uses `nvim-linux64.tar.gz`), so the existing extraction path stays correct.
zsh-autosuggestions, zsh-syntax-highlighting, and rust may be absent on boxes where the Brewfile hasn't been applied (Linux dev box) or where those brew packages aren't installed. Mirror the existing nvm/bun pattern: source only when the file exists.
Without an argument, sourcing nvm.sh triggers nvm_auto use, which tries to resolve a version (from .nvmrc or default-alias) and errors with "N/A: version N/A -> N/A is not yet installed" when neither is set. --no-use loads nvm without invoking auto-use; users still get the `nvm` function and can `nvm use <version>` explicitly when they want one.
…platform-assimilate
AL2023 on older/un-updated AMIs ships git 2.40, which lacks `git clone --revision`. Use git init + fetch --depth 1 <sha> + checkout instead, which pins the same single commit on any git version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the dotfiles bootstrap work on Linux/EC2 (Amazon Linux 2023) in addition to macOS, plus assorted robustness and cleanup.
assimilate.sh — cross-platform
uname: macOS-only symlinks (hammerspoon, vscode, zed, ghostty) andbrew bundleare skipped on Linux..bashrcis a regular file that sources the dotfilesbashrcfrom a stub — so EC2user_datasecret/region appends don't write into the tracked repo file.deltaandneoviminstalled from pinned upstream release tarballs per-platform (sidesteps brew bottle ABI drift; AL2023 has no neovim in default dnf repos). Installs land in$HOME/.local, no root needed..sha256sum.nvimis on PATH.clone_pinned— works on any git versionclone_pinnedpreviously usedgit clone --revision=<sha>, which was only added in git 2.49 (March 2025). Amazon Linux 2023's GA package is git 2.40, and a given AL2023 AMI is locked to its release's package set untildnf update— so a stale/un-updated AMI would fail on the first clone (unknown option 'revision') andset -ewould abort the whole bootstrap.The latest AL2023 (
2023.11, May 2026) does ship git 2.50.1, so a fully-updated current instance would have been fine — but rather than depend on AMI age,clone_pinnednow uses a version-independent form:Same shallow single-commit pin, no
--revision, works on git 2.40 and up. (Fetch-by-SHA relies on the server allowing reachable-SHA1-in-want, which GitHub enables — allclone_pinnedtargets are GitHub.)Robustness
~/.cargo/envand brew-shipped zsh plugin sources against missing files (zshrc + bashrc).nvmwith--no-useto suppress the "N/A" auto-use error when no.nvmrcis present.ls=lsdalias.Cleanup
k9s,py-spy,pyenv..claude/worktreesand dbtmanifest.jsonfrom file scans.Testing
bash -n/zsh -npass on all touched scripts.amazonlinux:2023container (installs git/tar/zsh, copies the repo to/root/dotfiles, runsassimilate.sh, asserts the.bashrcstub, symlinks, anddelta/nviminstalls). Not yet run in this PR.References
--revision2023.11packages — git 2.50.1