Skip to content

Skip tmux.conf migration when the file is not writable - #9286

Open
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9284-readonly-tmux-migration
Open

Skip tmux.conf migration when the file is not writable#9286
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9284-readonly-tmux-migration

Conversation

@fresh3nough

Copy link
Copy Markdown

Summary

Fixes #9284.

migrations/1784401744.sh rewrote ~/.config/tmux/tmux.conf with sed -i under bash -euo pipefail (how omarchy-migrate runs every migration). Declarative setups (Nix/home-manager) keep that path as a symlink into a read-only store:

  • GNU sed -i replaces the symlink with a regular file (breaks the declarative link), or
  • a hard write failure aborts the whole migration, including the hardware package installs that follow, so omarchy-migrate never writes a completion marker and retries forever.

Change

Match migrations/1785189600.sh: rewrite via a temp file and cat >"$tmux_config" (write-through keeps a writable symlink's target). If the write is refused, print a skip notice and continue so hardware backfill still runs.

Test plan

  • Reproduced on GCP VM: sed -i on a store symlink → link replaced (BUG_REPRODUCED_symlink_replaced)
  • After fix: migration exits 0, symlink + store content unchanged, skip message printed
  • Writable symlink still rewritten through the target
  • ./test/shell.d/tmux-readonly-migration-test.sh passes
./test/shell.d/tmux-readonly-migration-test.sh

migrations/1784401744.sh used sed -i on ~/.config/tmux/tmux.conf under
bash -e. Nix/home-manager keeps that path as a symlink into a read-only
store; GNU sed -i replaces the symlink with a regular file, and a hard
write failure aborts the whole migration (including hardware package
installs) so omarchy-migrate retries forever. Rewrite via a temp file
and write through the path like the later tmux migration; skip with a
notice when the write is refused.

Fixes omacom#9284

Signed-off-by: fresh3nough <anonwurcod@proton.me>
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.

Upgrade migration fails if tmux.conf is read-only.

1 participant