diff options
| author | 2026-05-20 13:56:09 +0100 | |
|---|---|---|
| committer | 2026-05-20 13:56:09 +0100 | |
| commit | 2d9ed00606be2f8c63aba719d00adf70fe6d4393 (patch) | |
| tree | 013dd78dcb1b316b69286b883e3f8dfad94ac142 | |
| parent | e66aa35ea314f522a2cdfaebdacf87894a44bd04 (diff) | |
| download | dotfiles-2d9ed00606be2f8c63aba719d00adf70fe6d4393.tar.gz dotfiles-2d9ed00606be2f8c63aba719d00adf70fe6d4393.tar.bz2 dotfiles-2d9ed00606be2f8c63aba719d00adf70fe6d4393.zip | |
refactor(nvim,zsh): remove Mason; use Home-Manager-provisioned tooling
LSPs, formatters, linters, and the lldb-dap debugger now come from
~/.nix-profile/bin (see nix/common.nix). lspconfig keeps the default
configs; we just opt-in via vim.lsp.enable() with an explicit list.
Changes:
- dot_config/nvim/lua/plugins/lsp.lua: drop mason*, replace
mason-lspconfig handler with explicit vim.lsp.enable({...}); drop
groovy/jenkins formatters and lint entries; drop systemd lint
(nginx + groovy + systemdlint tools dropped per plan).
- dot_config/nvim/lua/plugins/debug.lua: drop mason-nvim-dap; drop
codelldb adapter; switch dap.configurations.cpp to type='lldb'
(lldb-dap is the upstream successor, ships with pkgs.lldb).
- dot_config/nvim/init.lua: remove mason.nvim, mason-lspconfig.nvim,
mason-tool-installer.nvim, mason-nvim-dap.nvim from vim.pack.add.
- dot_config/nvim/lua/config/update.lua: remove MasonToolsUpdateSync.
- dot_config/zsh/dot_zshrc: flip plugin source order — prefer
~/.nix-profile/share, fall back to /usr/share/zsh (was the other
way around).
- nix/bootstrap.sh: drop the uv-python3.11 step (no longer needed
once Mason no longer source-builds Python LSPs on Ubuntu 20.04).
Phase 6 of the nix-on-host migration plan.
| -rw-r--r-- | dot_config/nvim/init.lua | 4 | ||||
| -rw-r--r-- | dot_config/nvim/lua/config/update.lua | 11 | ||||
| -rw-r--r-- | dot_config/nvim/lua/plugins/debug.lua | 14 | ||||
| -rw-r--r-- | dot_config/nvim/lua/plugins/lsp.lua | 89 | ||||
| -rw-r--r-- | dot_config/zsh/dot_zshrc | 15 | ||||
| -rwxr-xr-x | nix/bootstrap.sh | 33 |
6 files changed, 40 insertions, 126 deletions
diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 32873d3..7559556 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -68,9 +68,6 @@ vim.pack.add({ gh("folke/lazydev.nvim"), gh("neovim/nvim-lspconfig"), gh("j-hui/fidget.nvim"), - gh("williamboman/mason.nvim"), - gh("williamboman/mason-lspconfig.nvim"), - gh("WhoIsSethDaniel/mason-tool-installer.nvim"), gh("stevearc/conform.nvim"), gh("mrcjkb/rustaceanvim"), gh("mfussenegger/nvim-lint"), @@ -80,7 +77,6 @@ vim.pack.add({ { src = gh("miroshQa/debugmaster.nvim"), version = "dashboard" }, gh("mfussenegger/nvim-dap"), gh("theHamsta/nvim-dap-virtual-text"), - gh("jay-babu/mason-nvim-dap.nvim"), -- Runner gh("stevearc/overseer.nvim"), diff --git a/dot_config/nvim/lua/config/update.lua b/dot_config/nvim/lua/config/update.lua index bc7ee3d..7910dee 100644 --- a/dot_config/nvim/lua/config/update.lua +++ b/dot_config/nvim/lua/config/update.lua @@ -1,10 +1,10 @@ -- Update orchestrator. Invoked from the justfile via: -- nvim +'lua require("config.update").run()' -- --- Cleans orphan plugins, applies plugin updates without prompting, then --- runs :MasonToolsUpdateSync. Run interactively (not --headless) so the --- diff buffer that vim.pack.update opens is actually visible — that --- buffer IS the changelog. Quit manually with :qa once reviewed. +-- Cleans orphan plugins then applies plugin updates without prompting. +-- Run interactively (not --headless) so the diff buffer that +-- vim.pack.update opens is actually visible — that buffer IS the +-- changelog. Quit manually with :qa once reviewed. local M = {} @@ -34,9 +34,6 @@ function M.run() print("[pack] updating plugins…") vim.pack.update(nil, { force = true }) - - print("[mason] updating tools…") - vim.cmd("MasonToolsUpdateSync") end return M diff --git a/dot_config/nvim/lua/plugins/debug.lua b/dot_config/nvim/lua/plugins/debug.lua index bef0d1c..0d97713 100644 --- a/dot_config/nvim/lua/plugins/debug.lua +++ b/dot_config/nvim/lua/plugins/debug.lua @@ -22,11 +22,6 @@ dap.adapters.gdb = { args = { "--interpreter=dap" }, env = get_env_vars, } -dap.adapters.codelldb = { - type = "executable", - command = "codelldb", - env = get_env_vars, -} local function get_program() local _program @@ -53,8 +48,8 @@ end dap.configurations.cpp = { { - name = "codelldb Launch", - type = "codelldb", + name = "lldb-dap Launch", + type = "lldb", request = "launch", cwd = "${workspaceFolder}", program = get_program, @@ -68,8 +63,3 @@ dap.configurations.c = dap.configurations.cpp dap.configurations.rust = dap.configurations.cpp require("nvim-dap-virtual-text").setup({}) -require("mason-nvim-dap").setup({ - automatic_installation = false, - handlers = {}, - ensure_installed = {}, -}) diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua index a2a4036..5039d04 100644 --- a/dot_config/nvim/lua/plugins/lsp.lua +++ b/dot_config/nvim/lua/plugins/lsp.lua @@ -8,66 +8,30 @@ vim.lsp.enable("just") pcall(vim.lsp.enable, "tblgen_lsp_server") require("fidget").setup({}) -require("mason").setup({}) -require("mason-lspconfig").setup({ - ensure_installed = {}, - automatic_installation = false, - handlers = { - function(server_name) - vim.lsp.enable(server_name) - end, - }, -}) -require("mason-tool-installer").setup({ - ensure_installed = { - "actionlint", - "autotools-language-server", - -- basedpyright: provided by the system pkg manager (basedpyright-bin from - -- AUR on Arch, pkgs.basedpyright in remote-dev/home.nix on the VM). Mason's pypi - -- distro pulls `nodejs-wheel-binaries` whose Linux wheels are only - -- manylinux_2_28; uv's standalone python (manylinux2014) rejects them and - -- pip falls back to building Node from source, which fails on Ubuntu - -- 20.04's gcc 9.4 (<10, no -std=gnu++20). lspconfig finds it on PATH. - "bash-language-server", - "clangd", - "codelldb", - "codespell", - "css-lsp", - "dockerfile-language-server", - "gh", - "gh-actions-language-server", - "groovy-language-server", - "hadolint", - "html-lsp", - "jq", - "json-lsp", - "jsonlint", - "just-lsp", - "lua-language-server", - "markdownlint", - "mdformat", - "neocmakelsp", - "nginx-config-formatter", - "nginx-language-server", - "npm-groovy-lint", - "prettier", - "ruff", - "rust-analyzer", - "selene", - "shellcheck", - "shellharden", - "shfmt", - "stylelint", - "stylua", - "systemd-lsp", - "systemdlint", - "taplo", - "typescript-language-server", - "typos", - "yaml-language-server", - "yamllint", - "yq", - }, + +-- LSPs come from Home-Manager (see nix/common.nix). lspconfig ships the +-- default configs; we just opt-in per server. (Previously this was driven +-- by mason-lspconfig handlers; phase p6 of the nix migration removed +-- Mason entirely.) +vim.lsp.enable({ + "autotools_ls", + "basedpyright", + "bashls", + "clangd", + "cssls", + "dockerls", + "eslint", + "gh_actions_ls", + "html", + "jsonls", + "lua_ls", + "neocmake", + "ruff", + "rust_analyzer", + "systemd_ls", + "taplo", + "ts_ls", + "yamlls", }) vim.api.nvim_create_autocmd("LspAttach", { @@ -194,11 +158,9 @@ require("conform").setup({ bash = { "shfmt" }, cmake = { "cmake_format" }, css = { "prettier", "stylelint" }, - groovy = { "npm-groovy-lint" }, html = { "prettier" }, javascript = { "prettier" }, typescript = { "prettier" }, - jenkins = { "npm-groovy-lint" }, json = { "jq", "jsonlint" }, jsonc = { "prettier" }, just = { "just" }, @@ -230,12 +192,9 @@ local lint = require("lint") lint.linters_by_ft = { css = { "stylelint" }, dockerfile = { "hadolint" }, - groovy = { "npm-groovy-lint" }, - jenkins = { "npm-groovy-lint" }, json = { "jsonlint" }, markdown = { "markdownlint" }, makefile = { "checkmake" }, - systemd = { "systemdlint" }, yaml = { "yamllint", "yq" }, ghaction = { "actionlint" }, zsh = { "zsh" }, diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index b227c8f..f94b82e 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -418,7 +418,8 @@ _fzf_compgen_path() { fd --hidden --follow --exclude ".git" . "$1" } _fzf_compgen_dir() { fd --type d --hidden --follow --exclude ".git" . "$1" } # ── Plugins (must be sourced last) ──────────────────────────────────────────── -# Plugin locations: Arch system path first, ~/.nix-profile fallback for VM HM. +# Plugin locations: ~/.nix-profile (Home-Manager) first, Arch system path as +# fallback for un-bootstrapped states. _source_first() { local f for f in "$@"; do @@ -432,17 +433,17 @@ ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern) typeset -A ZSH_HIGHLIGHT_STYLES ZSH_HIGHLIGHT_STYLES[comment]='fg=yellow' _source_first \ - /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \ - $HOME/.nix-profile/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + $HOME/.nix-profile/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \ + /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh _source_first \ - /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh \ - $HOME/.nix-profile/share/zsh-autosuggestions/zsh-autosuggestions.zsh + $HOME/.nix-profile/share/zsh-autosuggestions/zsh-autosuggestions.zsh \ + /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh bindkey '^[[Z' autosuggest-accept # Shift-Tab to accept suggestion _source_first \ - /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh \ - $HOME/.nix-profile/share/zsh-history-substring-search/zsh-history-substring-search.zsh + $HOME/.nix-profile/share/zsh-history-substring-search/zsh-history-substring-search.zsh \ + /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh [[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" history-substring-search-up [[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" history-substring-search-down diff --git a/nix/bootstrap.sh b/nix/bootstrap.sh index 9f5e144..86f82ca 100755 --- a/nix/bootstrap.sh +++ b/nix/bootstrap.sh @@ -8,8 +8,7 @@ # 1. Install Nix (Determinate Systems installer, multi-user). # 2. Clone (or fast-forward) the dotfiles repo to ~/.local/share/dotfiles. # 3. Run `home-manager switch --flake .../nix#vm`. -# 4. Install python3.11 via `uv` (needed by Mason pip installs). -# 5. Add Nix-store zsh to /etc/shells and chsh the user. +# 4. Add Nix-store zsh to /etc/shells and chsh the user. # # Environment overrides: # DOTFILES_REPO Git URL (default: https://github.com/ruifm/dotfiles) @@ -35,9 +34,6 @@ else log "Nix already installed, skipping installer." fi -# ── 1b. (moved to step 4 — uv comes from the nix profile, only available -# after `home-manager switch`) ───────────────────────────────────────── - # Source nix env for the rest of this script (installer writes # /etc/profile.d/nix.sh but the current shell hasn't sourced it). if [ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then @@ -68,32 +64,7 @@ nix --extra-experimental-features 'nix-command flakes' \ run home-manager/master -- \ switch --impure --flake "$DIR/nix#vm" -b backup -# ── 4. Mason's python interpreter (via uv from the nix profile) ────────────── -# Mason installs some LSPs/linters into per-package pip venvs. We need a -# python3.11 that: -# (a) meets Mason's >=3.10 version requirement (Ubuntu 20.04 ships -# /usr/bin/python3 = 3.8 — too old), and -# (b) accepts manylinux wheels (Nix's python rejects them by design; -# pip then falls back to compiling `nodejs-wheel-binaries` from -# source, which fails on the host's gcc 9.4 — needs C++20). -# -# `uv python install 3.11` fetches a portable CPython build (python-build- -# standalone, manylinux-compatible) into ~/.local/share/uv/python/. We -# symlink its `python3.11` into ~/.local/bin/ (already on PATH from -# zprofile) so Mason discovers it. Does NOT shadow /usr/bin/python3 — -# leaf-tools policy intact. Works on any distro/release, no PPA required. -UV_BIN="$HOME/.nix-profile/bin/uv" -if [ -x "$UV_BIN" ]; then - if [ ! -x "$HOME/.local/bin/python3.11" ]; then - log "Installing python3.11 via uv (required for Mason pip installs)…" - "$UV_BIN" python install 3.11 - UV_PY311="$("$UV_BIN" python find 3.11)" - mkdir -p "$HOME/.local/bin" - ln -sf "$UV_PY311" "$HOME/.local/bin/python3.11" - fi -fi - -# ── 5. chsh to nix-store zsh ───────────────────────────────────────────────── +# ── 4. chsh to nix-store zsh ───────────────────────────────────────────────── NIX_ZSH="$HOME/.nix-profile/bin/zsh" if [ -x "$NIX_ZSH" ]; then if ! grep -qxF "$NIX_ZSH" /etc/shells 2>/dev/null; then |
