at 23.11-beta 829 B view raw
1{ lib, options, ... }: 2 3let 4 defs = lib.modules.mergeAttrDefinitionsWithPrio options._module.args; 5 assertLazy = pos: throw "${pos.file}:${toString pos.line}:${toString pos.column}: The test must not evaluate this the assertLazy thunk, but it did. Unexpected strictness leads to unexpected errors and performance problems."; 6in 7 8{ 9 options.result = lib.mkOption { }; 10 config._module.args = { 11 default = lib.mkDefault (assertLazy __curPos); 12 regular = null; 13 force = lib.mkForce (assertLazy __curPos); 14 unused = assertLazy __curPos; 15 }; 16 config.result = 17 assert defs.default.highestPrio == (lib.mkDefault (assertLazy __curPos)).priority; 18 assert defs.regular.highestPrio == lib.modules.defaultOverridePriority; 19 assert defs.force.highestPrio == (lib.mkForce (assertLazy __curPos)).priority; 20 true; 21}