5 result = lib.mkOption { };
7 type = lib.types.submoduleWith {
8 # I generally recommend against overriding lib, because that leads to
9 # slightly incompatible dialects of the module system.
10 # Nonetheless, it's worth guarding the property that the module system
11 # evaluates with a completely custom lib, as a matter of separation of
13 specialArgs.lib = { };
18 config.weird = args@{ ... /* note the lack of a `lib` argument */ }:
19 assert args.lib == { };
20 assert args.specialArgs == { lib = { }; };
22 options.foo = lib.mkOption { };
23 config.foo = lib.mkIf true "alright";
26 assert config.weird.foo == "alright";