lib: Harmonize package options which may not exist in nixpkgs

This commit is contained in:
Quentin Boyer 2025-01-30 22:53:55 +01:00 committed by nix-infra-bot
parent eb611349a7
commit a2f01876f7
6 changed files with 57 additions and 42 deletions

View file

@ -100,7 +100,6 @@
with-sources =
{
config,
options,
lib,
pkgs,
@ -158,8 +157,10 @@
# Enable unless disabled above
enable = !(lib.elem sourceName disabled);
}
# Some sources have a package option with no default
// lib.optionalAttrs (opts ? package && !(opts.package ? default)) { package = null; }
# Some sources are defined using mkUnpackagedOption whose default will throw
// lib.optionalAttrs (opts ? package && !(builtins.tryEval opts.package.default).success) {
package = null;
}
)
) options.plugins.none-ls.sources;
};