Make settings.lang_packages append instead of replace

Downstream modules assign settings.lang_packages.<lang> plainly, which
out-priorities mkOptionDefault and silently dropped the built-in
defaults (e.g. lintr, breaking R linting in downstream wrappers like the
project-template ed flake).

Move the built-in defaults into a separate settings.langPackageDefaults
option and compose defaults ++ lang_packages at the consumption sites
(catPkgs r/python/julia, quarto extraRPackages, neovide R host). A new
append-semantics check fails if defaults migrate back into lang_packages.

Also fix pre-existing inverted assertions in downstream-overrides check:
the override module sets cats.r = true, so assert presence, not absence.
This commit is contained in:
Daniel Winkler 2026-08-25 11:25:05 +10:00
commit 9a6e20110e
6 changed files with 206 additions and 113 deletions

View file

@ -14,6 +14,15 @@
# R.nvim v1.x owns its cache and temporary directories and exports
# RNVIM_COMPLDIR/RNVIM_TMPDIR during setup. Do not inject literal `$PWD`
# values into the wrapper environment.
#
# ponytail: with R_LIBS_USER unset-or-empty, loading compiled namespaces
# (S7 via btw) segfaults on macOS for bare-terminal launches outside the
# devShell hook. Any non-empty value avoids it; this store path exists,
# contains no libraries, and stays inert. The devShell hook overrides it
# with $PWD/.r-libs. Upgrade path: teach wlib to emit expandable defaults.
(lib.mkIf (config.cats.r or false) {
R_LIBS_USER = "${pkgs.rpkgs.rWrapper}";
})
];
# Environment variables with defaults (can be overridden by user)