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

@ -5,7 +5,10 @@
...
}:
let
rPackages = (pkgs.baseRPackages or [ ]) ++ config.settings.lang_packages.r;
rPackages =
(pkgs.baseRPackages or [ ])
++ config.settings.langPackageDefaults.r
++ config.settings.lang_packages.r;
rWrapperPkg = pkgs.rpkgs.rWrapper.override { packages = rPackages ++ [pkgs.nvimcom]; };
in
{