nvimConfig/modules/module/settings/hosts.nix
Daniel Winkler 9a6e20110e 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.
2026-08-25 11:33:02 +10:00

54 lines
1.3 KiB
Nix

{
config,
pkgs,
lib,
...
}:
let
rPackages =
(pkgs.baseRPackages or [ ])
++ config.settings.langPackageDefaults.r
++ config.settings.lang_packages.r;
rWrapperPkg = pkgs.rpkgs.rWrapper.override { packages = rPackages ++ [pkgs.nvimcom]; };
in
{
config.hosts = lib.mkMerge [
{
node.nvim-host.enable = true;
perl.nvim-host.enable = true;
ruby.nvim-host.enable = true;
g = {
nvim-host.enable = true;
nvim-host.package = "${pkgs.neovide}/bin/neovide";
nvim-host.argv0 = "neovide";
nvim-host.flags."--neovim-bin" = "${builtins.placeholder "out"}/bin/${config.binName}";
};
}
(lib.mkIf (config.cats.julia or false) {
jl = {
nvim-host.enable = true;
nvim-host.package = "${pkgs.julia-bin}/bin/julia";
nvim-host.argv0 = "julia";
nvim-host.addFlag = [
"--project=@."
];
};
})
(lib.mkIf (config.cats.python or false) {
python3.nvim-host.enable = true;
})
(lib.mkIf (config.cats.r or false) {
r = {
nvim-host.enable = true;
nvim-host.package = "${rWrapperPkg}/bin/R";
nvim-host.argv0 = "R";
nvim-host.addFlag = [
"--no-save"
"--no-restore"
];
};
})
];
}