mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
lib.modules: inline warnDeprecation
Saves 0.5% of all thunks for my personal config.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user