diff --git a/pkgs/lib/modules.nix b/pkgs/lib/modules.nix index 9bd3b4aab8c..8f6ae5666b1 100644 --- a/pkgs/lib/modules.nix +++ b/pkgs/lib/modules.nix @@ -217,9 +217,14 @@ rec { ) declarations; decl = - addOptionMakeUp - { name = addName name; recurseInto = recurseForOption; } - (mergeOptionDecls decls); + lib.addErrorContext "${eol + }while enhancing option '${addName name}'.${eol + }${errorSource declarations}${eol + }" ( + addOptionMakeUp + { name = addName name; recurseInto = recurseForOption; } + (mergeOptionDecls decls) + ); value = decl // (with config; { inherit (config) isNotDefined;