lib.modules: inline warnDeprecation

Saves 0.5% of all thunks for my personal config.
This commit is contained in:
Eman Resu
2026-06-03 12:54:37 -04:00
committed by Eman Resu
parent d3bbd01933
commit d03c2169d2

View File

@@ -1138,15 +1138,13 @@ let
# Apply the 'apply' function to the merged value. This allows options to
# yield a value computed from the definitions
value = if opt ? apply then opt.apply res.mergedValue else res.mergedValue;
warnDeprecation =
if (opt.type.deprecationMessage != null) then
warn "The type `types.${opt.type.name}' of option `${showOption loc}' defined in ${showFiles opt.declarations} is deprecated. ${opt.type.deprecationMessage}"
else
x: x;
in
warnDeprecation opt
(
if opt.type.deprecationMessage != null then
warn "The type `types.${opt.type.name}' of option `${showOption loc}' 'defined in ${showFiles opt.declarations} is deprecated. ${opt.type.deprecationMessage}" opt
else
opt
)
// {
value = addErrorContext "while evaluating the option `${showOption loc}':" value;
inherit (res.defsFinal') highestPrio;