diff options
| author | 2026-09-21 14:22:38 +0200 | |
|---|---|---|
| committer | 2026-09-21 14:22:38 +0200 | |
| commit | 0c7b0c9d7dbb8193fc8e1089c51941e385abd933 (patch) | |
| tree | a5b53b4f9bdb5a32012d59c4de98b86a12b4d9e4 /openspec | |
| parent | db86c80a9931074c574c88a0a7ea5339c06b34f5 (diff) | |
| download | desktop-flake-0c7b0c9d7dbb8193fc8e1089c51941e385abd933.tar.gz desktop-flake-0c7b0c9d7dbb8193fc8e1089c51941e385abd933.tar.bz2 desktop-flake-0c7b0c9d7dbb8193fc8e1089c51941e385abd933.zip | |
Provision nodejs/python3/unzip for mason.nvim installers
mason.nvim (externally-managed Neovim dotfiles config) was failing to
install several LSP servers and tools because npm, python3, and unzip
weren't on PATH in the Home Manager profile.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BBSd4VBfoKHjE1HR3P8kmn
Diffstat (limited to 'openspec')
4 files changed, 104 insertions, 0 deletions
diff --git a/openspec/changes/fix-mason-installer-deps/.openspec.yaml b/openspec/changes/fix-mason-installer-deps/.openspec.yaml new file mode 100644 index 0000000..563fab5 --- /dev/null +++ b/openspec/changes/fix-mason-installer-deps/.openspec.yaml | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | schema: spec-driven | ||
| 2 | created: 2026-09-21 | ||
diff --git a/openspec/changes/fix-mason-installer-deps/proposal.md b/openspec/changes/fix-mason-installer-deps/proposal.md new file mode 100644 index 0000000..5734f55 --- /dev/null +++ b/openspec/changes/fix-mason-installer-deps/proposal.md | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ## Why | ||
| 2 | |||
| 3 | `mason.nvim` (managed by the externally-owned, Stow-linked Neovim dotfiles config) | ||
| 4 | fails to install several LSP/tooling packages on this flake's Home Manager profile: | ||
| 5 | `pyright`, `bash-language-server`, `yaml-language-server`, | ||
| 6 | `typescript-language-server`, `css-lsp`, and `html-lsp` fail because `npm` is not on | ||
| 7 | `PATH`; `debugpy` fails because no `python3`/`python` is on `PATH`; `terraform-ls` | ||
| 8 | fails because `unzip` is not on `PATH`. `programs.neovim.withPython3 = true` only | ||
| 9 | wires up Neovim's Python *provider* (pynvim) and does not put a `python3` binary on | ||
| 10 | `PATH`, so it does not cover this. `js-debug-adapter` and `lua-language-server` | ||
| 11 | already install successfully and need no change. | ||
| 12 | |||
| 13 | ## What Changes | ||
| 14 | |||
| 15 | - Provision `nodejs` (for `npm`), `python3`, and `unzip` on `PATH` via the shared | ||
| 16 | Home Manager profile, so `mason.nvim`'s installers can find the interpreters/tools | ||
| 17 | they shell out to. | ||
| 18 | |||
| 19 | ## Capabilities | ||
| 20 | |||
| 21 | ### New Capabilities | ||
| 22 | - `editor-toolchain`: The shared home-manager profile provisions the runtime | ||
| 23 | toolchain (interpreters, package managers, archive tools) that the externally | ||
| 24 | Stow-managed Neovim/mason.nvim config depends on to install and run LSP servers | ||
| 25 | and debug adapters, without home-manager owning any of that config itself. | ||
| 26 | |||
| 27 | ### Modified Capabilities | ||
| 28 | (none — `developer-environment` covers general most-used CLI tools, not the | ||
| 29 | Neovim/mason.nvim dependency contract, so a new capability is used instead of | ||
| 30 | overloading that one.) | ||
| 31 | |||
| 32 | ## Impact | ||
| 33 | |||
| 34 | - `modules/home/editor.nix`: extend the existing `home.packages` list (already used | ||
| 35 | for `tree-sitter`/`stdenv.cc`, the same "tools the dotfiles-owned nvim config | ||
| 36 | needs" pattern) with `nodejs`, `python3`, `unzip`. | ||
| 37 | - Applies to both Home Manager configs that import this module — `tom@linux` and | ||
| 38 | `tom@darwin` (per `flake.nix`) — covering all supported systems. | ||
| 39 | - No changes to the externally-managed dotfiles/Neovim Lua config itself. | ||
diff --git a/openspec/changes/fix-mason-installer-deps/specs/editor-toolchain/spec.md b/openspec/changes/fix-mason-installer-deps/specs/editor-toolchain/spec.md new file mode 100644 index 0000000..8298fbd --- /dev/null +++ b/openspec/changes/fix-mason-installer-deps/specs/editor-toolchain/spec.md | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | ## Purpose | ||
| 2 | |||
| 3 | Provisions, via the shared home-manager profile, the runtime toolchain that the | ||
| 4 | externally Stow-managed Neovim/mason.nvim config depends on to install and run LSP | ||
| 5 | servers, formatters, and debug adapters — without home-manager owning that editor | ||
| 6 | config itself. | ||
| 7 | |||
| 8 | ## ADDED Requirements | ||
| 9 | |||
| 10 | ### Requirement: mason.nvim installer dependencies are provisioned | ||
| 11 | The shared home-manager profile SHALL include a Node.js runtime (providing `npm`), a | ||
| 12 | Python 3 interpreter (providing `python3`), and `unzip` on `PATH`, so that | ||
| 13 | `mason.nvim`'s package installers can locate the tools they shell out to. | ||
| 14 | |||
| 15 | #### Scenario: npm-based Mason package installs successfully | ||
| 16 | - **WHEN** the shared home profile is activated and `mason.nvim` installs an | ||
| 17 | npm-based package (for example an LSP server distributed via npm) | ||
| 18 | - **THEN** `mason.nvim`'s installer finds `npm` on `PATH` and the installation does | ||
| 19 | not fail with an `ENOENT`/"could not find executable" error for `npm` | ||
| 20 | |||
| 21 | #### Scenario: Python-based Mason package installs successfully | ||
| 22 | - **WHEN** the shared home profile is activated and `mason.nvim` installs a | ||
| 23 | Python-based package (for example `debugpy`) | ||
| 24 | - **THEN** `mason.nvim`'s installer finds a `python3` interpreter on `PATH` and the | ||
| 25 | installation does not fail with a "no python3 installation found" error | ||
| 26 | |||
| 27 | #### Scenario: Archive-based Mason package installs successfully | ||
| 28 | - **WHEN** the shared home profile is activated and `mason.nvim` installs a package | ||
| 29 | distributed as a zip archive (for example `terraform-ls`) | ||
| 30 | - **THEN** `mason.nvim`'s installer finds `unzip` on `PATH` and the installation does | ||
| 31 | not fail with an `ENOENT`/"could not find executable" error for `unzip` | ||
| 32 | |||
| 33 | ### Requirement: Editor toolchain packages do not manage editor configuration | ||
| 34 | Packages provisioned by this capability SHALL supply only the underlying | ||
| 35 | interpreters/tools that the externally-managed Neovim dotfiles config depends on; | ||
| 36 | this capability SHALL NOT generate, own, or otherwise manage any Neovim | ||
| 37 | configuration file (for example `init.lua` or plugin/LSP configuration). | ||
| 38 | |||
| 39 | #### Scenario: No competing Neovim configuration is generated | ||
| 40 | - **WHEN** the shared home profile provisions the editor toolchain packages | ||
| 41 | - **THEN** no Neovim configuration file is created or managed by this capability — | ||
| 42 | the externally Stow-managed dotfiles config remains the sole owner of that | ||
| 43 | configuration | ||
diff --git a/openspec/changes/fix-mason-installer-deps/tasks.md b/openspec/changes/fix-mason-installer-deps/tasks.md new file mode 100644 index 0000000..2d2d259 --- /dev/null +++ b/openspec/changes/fix-mason-installer-deps/tasks.md | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | ## 1. Provision editor toolchain packages | ||
| 2 | |||
| 3 | - [x] 1.1 In `modules/home/editor.nix`, add `nodejs`, `python3`, and `unzip` to the | ||
| 4 | existing `home.packages` list (alongside `tree-sitter`/`stdenv.cc`), with a | ||
| 5 | short comment noting they're required by `mason.nvim`'s installers; verify by | ||
| 6 | reading the file back and confirming the three entries are present. | ||
| 7 | - [ ] 1.2 Verify the flake still evaluates: run `nix flake check` and confirm it | ||
| 8 | succeeds. | ||
| 9 | |||
| 10 | ## 2. Verify Mason installs succeed | ||
| 11 | |||
| 12 | - [ ] 2.1 Apply the profile on an affected host (`home-manager switch --flake | ||
| 13 | .#tom@linux` or `.#tom@darwin`, whichever is reachable) and confirm the | ||
| 14 | activation completes without error. | ||
| 15 | - [ ] 2.2 In Neovim, delete `~/.local/state/nvim/mason.log` (or run `:MasonUninstallAll` | ||
| 16 | then reinstall), trigger installation of the previously-failing packages | ||
| 17 | (`pyright`, `bash-language-server`, `debugpy`, `terraform-ls`, | ||
| 18 | `yaml-language-server`, `typescript-language-server`, `css-lsp`, `html-lsp`), | ||
| 19 | and confirm `:Mason` reports them all installed with no `npm`/`python3`/`unzip` | ||
| 20 | "could not find executable" errors in the new log. | ||
