1{ lib, options, ... }:
2
3let
4 defs = lib.modules.mergeAttrDefinitionsWithPrio options._module.args;
5 assertLazy =
6 pos:
7 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.";
8in
9
10{
11 options.result = lib.mkOption { };
12 config._module.args = {
13 default = lib.mkDefault (assertLazy __curPos);
14 regular = null;
15 force = lib.mkForce (assertLazy __curPos);
16 unused = assertLazy __curPos;
17 };
18 config.result =
19 assert defs.default.highestPrio == (lib.mkDefault (assertLazy __curPos)).priority;
20 assert defs.regular.highestPrio == lib.modules.defaultOverridePriority;
21 assert defs.force.highestPrio == (lib.mkForce (assertLazy __curPos)).priority;
22 true;
23}