fix(nb): manage project.nvim history as JSON for the 26.05 coffebar fork #127

Merged
dominik.polakovics merged 1 commit from fix/nb-project-history-json into main 2026-06-07 20:34:11 +02:00

Problem

After the 26.05 upgrade, nvim's project list came up empty.

NixOS 26.05 updated project-nvim to project.nvim v4 (the coffebar fork). That fork reads/writes a JSON history file ~/.local/share/nvim/project_nvim/project_history.json, whereas the old plugin used plain-text project_history. Our home-manager seed (hosts/nb/users/dominik.nix) still pointed at the old plain-text filename, so the new plugin only ever saw its own empty project_history.json ([]) and showed no projects.

(Separately, the nvim startup errors were already fixed by #126 — that fix had just been rolled back on nb by a failed activation, now re-activated.)

Change

The project list is declarative — the repo is the source of truth.

  • Add hosts/nb/users/configs/project_history.json in the new {path, name} spec.
  • Manage it via a writable force-copy activation that overwrites the file on every nixos-rebuild (repo wins).
  • Delete the now-dead plain-text configs/project_history.

Why not home.file with force?

home.file makes the target a read-only symlink into the nix store. project.nvim v4 writes its history on exit and on opening a project; against a read-only file it throws File restricted! (verified: error fires from write_history on VimLeavePre). A writable force-copy keeps the list declarative and lets the plugin run without errors. Trade-off: projects opened between rebuilds are reset to the repo list on the next activation — which is the intended source-of-truth behaviour; add new projects to project_history.json.

Verification

  • Pre-commit dry-build of nb: :: nb OK.
  • Reproduced the read-only failure (File restricted!) against a store-symlinked history; the force-copy variant loads the list with no errors.
## Problem After the 26.05 upgrade, nvim's project list came up empty. NixOS 26.05 updated `project-nvim` to **project.nvim v4 (the coffebar fork)**. That fork reads/writes a JSON history file `~/.local/share/nvim/project_nvim/project_history.json`, whereas the old plugin used plain-text `project_history`. Our home-manager seed (`hosts/nb/users/dominik.nix`) still pointed at the old plain-text filename, so the new plugin only ever saw its own empty `project_history.json` (`[]`) and showed no projects. (Separately, the nvim *startup* errors were already fixed by #126 — that fix had just been rolled back on `nb` by a failed activation, now re-activated.) ## Change The project list is declarative — the repo is the source of truth. - Add `hosts/nb/users/configs/project_history.json` in the new `{path, name}` spec. - Manage it via a **writable force-copy activation** that overwrites the file on every `nixos-rebuild` (repo wins). - Delete the now-dead plain-text `configs/project_history`. ### Why not `home.file` with `force`? `home.file` makes the target a **read-only symlink into the nix store**. project.nvim v4 writes its history on exit and on opening a project; against a read-only file it **throws `File restricted!`** (verified: error fires from `write_history` on `VimLeavePre`). A writable force-copy keeps the list declarative *and* lets the plugin run without errors. Trade-off: projects opened between rebuilds are reset to the repo list on the next activation — which is the intended source-of-truth behaviour; add new projects to `project_history.json`. ## Verification - Pre-commit dry-build of `nb`: `:: nb OK`. - Reproduced the read-only failure (`File restricted!`) against a store-symlinked history; the force-copy variant loads the list with no errors.
NixOS 26.05 ships project.nvim v4 (the coffebar fork), which reads/writes
project_history.json instead of the old plain-text project_history. The
home.file symlink seeded the old filename, so the new plugin only saw its
own empty project_history.json and the project list came up empty.

Seed project_history.json (new {path,name} spec) via a copy-if-missing
activation rather than a read-only symlink, so the plugin can keep
maintaining the list as projects are opened (/home is persisted).
dominik.polakovics force-pushed fix/nb-project-history-json from 51105d32ee to 09eb73489c 2026-06-07 20:21:04 +02:00 Compare
dominik.polakovics changed title from fix(nb): seed project.nvim history as JSON for the 26.05 coffebar fork to fix(nb): manage project.nvim history as JSON for the 26.05 coffebar fork 2026-06-07 20:21:26 +02:00
dominik.polakovics deleted branch fix/nb-project-history-json 2026-06-07 20:34:11 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/nixos!127
No description provided.