Skip to content

πŸ› fix: cross-platform portability groundwork (Phase 0) - #10

Merged
hadees merged 10 commits into
masterfrom
fix/cross-platform-portability
Jul 13, 2026
Merged

πŸ› fix: cross-platform portability groundwork (Phase 0)#10
hadees merged 10 commits into
masterfrom
fix/cross-platform-portability

Conversation

@hadees

@hadees hadees commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 0 of the cross-platform dotfiles plan (macOS + Linux + WSL + ephemeral remotes): fixes the portability bugs a file-by-file audit found, before any structural migration. Each concern is its own commit.

  • Untrack .gnupg/gpg-agent.conf β€” hard-coded /opt/homebrew/bin/pinentry-mac (breaks on Linux) and is vestigial: signing here is SSH-format via 1Password, no GPG keypair.
  • Move commit.gpgsign = true to ~/.gitconfig.local β€” fresh boxes without the 1Password signer previously failed every commit; signing is now a per-machine opt-in beside the rest of the signing config.
  • Harden bootstrap.sh β€” stale .osx exclude renamed to .macos (the 763-line mac-only script was landing in every $HOME), git pull --ff-only with offline fallback, and ~/.zshrc only sourced when actually running zsh.
  • Remove bin/itunes β€” 842 lines of AppleScript for an app that no longer exists.
  • Actually run op inject β€” .extra.tmpl and CLAUDE.md claimed bootstrap renders ~/.extra; now it does (guarded on op present and ~/.extra missing).
  • Darwin guards + Linux shims β€” update() no longer runs softwareupdate/brew unconditionally; pbcopy/pbpaste/open get xclip/xsel/xdg-open fallbacks in the existing command -v style.
  • Close the CI gap β€” new tests/shell.bats parses and smoke-sources the zsh layer on both CI platforms; bootstrap tests stub op and assert .macos stays out of $HOME.

Test plan

  • bats tests β€” 9/9 green locally
  • Signed commit made after the gpgsign move (verified Good "git" signature)
  • CI green on ubuntu-latest + macos-latest

πŸ€– Generated with Claude Code

hadees and others added 8 commits July 12, 2026 17:51
The update alias asked for the password twice: brew/npm/uv run long
enough between `sudo softwareupdate` and the trailing `sudo gem` steps
that the 5-minute sudo timestamp expires. Now an update() function in
.functions authenticates upfront and refreshes the timestamp every 60s
in the background (same pattern as ~/.macos), with an EXIT trap killing
the loop even on Ctrl-C.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
It hard-coded /opt/homebrew/bin/pinentry-mac (Apple Silicon macOS only,
breaks when deployed to Linux) and is vestigial anyway β€” commit signing
here is SSH-format via 1Password with no GPG keypair. The deployed
~/.gnupg/gpg-agent.conf stays; it is just no longer managed by the repo.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The tracked .gitconfig enabled signing globally, so every fresh machine
without the 1Password signer failed all commits until manually disabled.
Signing now lives entirely in machine-local config alongside the rest of
the signing setup (gpg.format, op-ssh-sign path, signingkey); fresh boxes
default to unsigned commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- The rsync exclude still said ".osx" (renamed upstream to .macos years
  ago), so the mac-only defaults script was landing in every $HOME.
- git pull now uses --ff-only and tolerates being offline or on a
  diverged clone instead of erroring mid-bootstrap.
- ~/.zshrc is zsh-only syntax but was sourced unconditionally from this
  bash script; now only sourced when running under zsh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
842 lines of AppleScript targeting the iTunes app, which no longer
exists on modern macOS (replaced by Music) and never existed on Linux.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
.extra.tmpl and CLAUDE.md both claimed bootstrap.sh renders the secrets
template, but no such call existed β€” a fresh machine silently ended up
with no ~/.extra. Bootstrap now renders it when the op CLI is present
and ~/.extra doesn't exist yet, and the "Next steps" output documents
the manual command for every other case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
update() ran softwareupdate and brew unconditionally, failing on Linux;
both are now guarded. pbcopy/pbpaste get xclip/xsel fallbacks and open
gets xdg-open, following the existing command -v fallback style, so the
clip alias and open-dependent functions work off-mac.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI ran on ubuntu but never parsed or sourced the zsh layer, so Linux
breakage in .aliases/.functions was invisible. New shell.bats parses
every shell file and smoke-sources the zsh layer, failing on parse
errors, missing commands, or missing files at source time. bootstrap
tests now stub op (so runs never touch 1Password) and assert .macos
stays out of $HOME.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hadees hadees self-assigned this Jul 12, 2026
hadees and others added 2 commits July 12, 2026 19:31
Rocky runs in a rockylinux:9 container (no hosted Rocky runners exist)
with bats-core installed from source. WSL runs real Ubuntu-24.04 under
Vampire/setup-wsl on a windows-2025 runner; core.autocrlf is forced off
before checkout because .gitattributes has line-ending normalization
deliberately disabled and Windows runners default to autocrlf=true.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI runners are ephemeral VMs, so mutating system preferences there is
free β€” .macos now actually runs in the macOS job and a sample of
settings is asserted via defaults read, instead of only grepping the
script text. Double-guarded (Darwin + MACOS_APPLY_OK=1) so a plain
`bats tests` on a real Mac always skips it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hadees
hadees merged commit 5e661d6 into master Jul 13, 2026
4 checks passed
@hadees
hadees deleted the fix/cross-platform-portability branch July 13, 2026 01:00
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