plugins/efmls: package option defaultText should not depend on pkgs

The `defaultText` was conditional on default.
Specifically, `default.meta.platforms`.

This is not good, because it means the package must be evaluated in
order to build the docs.
This commit is contained in:
Matt Sturgeon 2025-01-24 22:11:38 +00:00
parent 09733a5539
commit 88652ce69a
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -44,10 +44,13 @@ in
# Filter package defaults that are not compatible with the current platform
(lib.attrsets.mapAttrs (
_: opt:
if lib.meta.availableOn pkgs.stdenv.hostPlatform opt.default then
opt
else
builtins.removeAttrs opt [ "defaultText" ] // { default = null; }
opt
// {
default = if lib.meta.availableOn pkgs.stdenv.hostPlatform opt.default then opt.default else null;
defaultText = lib.literalMD ''
`${opt.defaultText.text}` if available on the current system, otherwise null
'';
}
))
];