Skip to content

nvim: load the theme module from nvim-lua/ (fixes "module 'theme' not found" before the switch) - #421

Merged
mecattaf merged 4 commits into
theme-switcherfrom
theme-switcher-nvim-module
Sep 23, 2026
Merged

mecattaf merged 4 commits into
theme-switcherfrom
theme-switcher-nvim-module

Conversation

@mecattaf

Copy link
Copy Markdown
Owner

Stacked on #417.

The bug

Opening nvim on the coordinator with #417's checkout but before its nixos-rebuild switch:

/home/tom/.config/nvim/lua/plugins/lualine.lua:144: module 'theme' not found

lualine.lua is a per-file raw link, so it already carried the new require('theme'). lua/theme.lua was a new per-file link, and those only appear after a switch. The design doc says a checkout ahead of its switch degrades gracefully; nvim did not.

The fix

  • theme.lua moves to home/dot_local/bin/nvim-lua/. ~/.local/bin is one whole-dir link into the checkout, and init.lua puts ~/.local/bin/nvim-lua/?.lua on package.path before plugins load, so the module resolves with no rebuild at all.
  • home/nvim.nix drops the lua/theme.lua entry.
  • lualine.lua wraps the require in pcall with noir's two colours as fallback.
  • The theme script's live reload is unchanged: same module name, same search path.

Verified

  • On the coordinator's current, pre-switch generation: headless nvim fires VeryLazy, require('theme') returns the noir palette, lualine loads and sets its highlights.
  • The coordinator Home Manager generation builds.

The checkout also has uncommitted Ghostty theme work from another session; none of it is in this PR.

🤖 Generated with Claude Code

…ch works

Opening nvim on the coordinator after pulling #417, before its switch:

  lua/plugins/lualine.lua:144: module 'theme' not found

lualine.lua is a per-file RAW link, so it already had the new
`require('theme')`; lua/theme.lua was a NEW nvimRaw entry, and per-file
links only appear on a switch. Exactly the "checkout ahead of its switch"
case the design doc promised would degrade gracefully, and nvim did not.

- theme.lua moves to home/dot_local/bin/nvim-lua/. ~/.local/bin is ONE
  out-of-store link into the checkout, and init.lua appends
  ~/.local/bin/nvim-lua/?.lua to package.path before plugins load (the same
  path claude_slash.lua already rides), so require('theme') resolves as soon
  as the checkout has the file — no rebuild in either direction.
- nvim.nix drops the lua/theme.lua nvimRaw entry.
- lualine.lua pcalls the require, with noir's two colours as fallback, so a
  missing module can never cost the status line again.
- `theme`'s live reload (`require("theme").reload()` over --remote-expr) is
  unchanged: same module name, same package.path.

Verified on the coordinator's CURRENT (pre-switch) generation: nvim --headless
fires VeryLazy, require('theme') returns the noir palette, lualine loads and
sets its highlights. home-manager-generation builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mecattaf mecattaf added the behaviour-changing triage bucket 2026-09-20 label Sep 20, 2026
mecattaf and others added 3 commits September 22, 2026 17:14
…fig dir; drop the dead claude-credentials seed

Two Claude Code seats live on the coordinator: cc in ~/.claude (the personal
Claude Max login) and cc2 in ~/.claude-work (the leger.run login). Tom re-logged
both by hand on 2026-09-22; this makes the arrangement durable.

- fish: cc/cac/cc2/cac2 become one launcher. Claude Code never saves workspace
  trust for $HOME (docs: "trust acceptance is held for the current session only
  and is not written to disk"), so a seat typed in ~ showed "Accessing
  workspace" on every launch; the launcher now moves into $CLAUDE_ENVELOPE
  (default ~/today) when started from ~. `cc` clears CLAUDE_CONFIG_DIR
  explicitly: a terminal opened from a cc2 session inherits it, and the old
  alias then silently started cc2 (measured with a stub claude under
  runtime-test). TALLY_SEAT names the seat to hooks and receipts. cc3 lines are
  untouched.
- secrets: remove the claude-credentials seed and its age file. The token had
  been dead since the 2026-08-04 rotation, and a seed that fires whenever
  ~/.claude/.credentials.json is absent could only revert a fresh /login after
  a rebuild. Verified: nix eval of the coordinator's age.secrets no longer lists
  it and the other nineteen are intact.
- AGENTS.md: the seats paragraph (which login is which directory, the launch
  rule, where the meters are).

Not a rebuild, not a merge; both are Tom's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
home/dot_config/ghostty/config.ghostty mirrors kitty.conf key for key so a cmux terminal pane looks like a kitty window, and names the gap wherever Ghostty has no equivalent key. home/home.nix adds ghostty to configDirs so the out-of-store symlink is declared: ~/.config/ghostty already points into this checkout (created 2026-09-17) but is absent from generation 239's home-manager-files, so it is an orphan today and this is what makes it legitimate. home/themes/default.nix renders a per-theme ghostty fragment alongside kitty.conf. docs/theme-switcher-2026-09-17.md gains the consumer row.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comments only, verified: zero non-comment added or removed lines across the three files, so no partition table, device id, size, mountpoint or filesystem change. Records which disks belong to whom and which depart with the worker chassis. Per FRONT-10 no agent invents or enforces the return date.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

behaviour-changing triage bucket 2026-09-20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant