From fc30488896710667e5d4fd970de81d9daa3cdf88 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Thu, 14 May 2026 11:31:44 +0100 Subject: fix(nvim,remote-dev): fall back to PATH node + provide JRE/shellharden/python3-venv copilot.lua was hard-coding the chezmoi-pinned Node 24 at ~/.local/share/copilot-node/bin/node, which only exists on the Arch host where chezmoi runs run_onchange_after_install-copilot-node.sh. On the remote-dev VM the path is absent, so copilot-language-server spawned with cmd[0]= and printed 'Could not determine Node.js version'. Probe the pinned path with vim.fn.executable() and fall back to 'node' from PATH otherwise. For the VM PATH 'node' to be a supported version, switch home.nix from the rolling 'nodejs' alias to 'nodejs_24' (the version the chezmoi script also pins on the host). Address the cluster of Mason install failures on the VM: - autotools-language-server, codespell, mdformat, nginx-language-server, systemdlint -- pip-installed; fail because Ubuntu's python3 ships without venv. bootstrap.sh now apt-installs python3-venv; README documents the manual command for existing VMs. - groovy-language-server -- needs a JRE. Add 'jre' to home.packages. - shellharden -- Mason's cargo fallback can't run under our leaf-tools policy. Provide the binary via nix-profile instead so Mason finds it on PATH. --- dot_config/nvim/lua/plugins/ai.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'dot_config') diff --git a/dot_config/nvim/lua/plugins/ai.lua b/dot_config/nvim/lua/plugins/ai.lua index 6578037..6ebc6f5 100644 --- a/dot_config/nvim/lua/plugins/ai.lua +++ b/dot_config/nvim/lua/plugins/ai.lua @@ -1,12 +1,19 @@ +-- Prefer the chezmoi-pinned Node 24 (host has Arch's system node 26, which +-- breaks copilot-language-server — see +-- ~/.local/share/chezmoi/run_onchange_after_install-copilot-node.sh). Fall +-- back to `node` on PATH for hosts that don't run chezmoi (remote-dev VM +-- via Nix Home-Manager, where home.nix pins nodejs_24 in the profile). +local pinned_node = vim.fs.joinpath( + vim.env.XDG_DATA_HOME or (vim.env.HOME .. "/.local/share"), + "copilot-node/bin/node" +) +local copilot_node = vim.fn.executable(pinned_node) == 1 and pinned_node + or "node" + require("copilot").setup({ suggestion = { enabled = false }, panel = { enabled = false }, - -- Pinned Node 24 runtime; system nodejs (26.x) is incompatible with - -- copilot-language-server. See ~/.local/share/chezmoi/run_onchange_after_install-copilot-node.sh - copilot_node_command = vim.fs.joinpath( - vim.env.XDG_DATA_HOME or (vim.env.HOME .. "/.local/share"), - "copilot-node/bin/node" - ), + copilot_node_command = copilot_node, server_opts_overrides = { settings = { telemetry = { -- cgit v1.3.1