at master 623 B view raw
1{ lib, ... }: 2let 3 inherit (lib) mkOption types; 4in 5{ 6 options.examples = mkOption { 7 type = types.lazyAttrsOf ( 8 types.unique { 9 message = "We require a single definition, because seeing the whole value at once helps us maintain critical invariants of our system."; 10 } (types.attrsOf types.str) 11 ); 12 }; 13 imports = [ 14 { 15 examples.merged = { 16 b = "bee"; 17 }; 18 } 19 { examples.override = lib.mkForce { b = "bee"; }; } 20 ]; 21 config.examples = { 22 merged = { 23 a = "aye"; 24 }; 25 override = { 26 a = "aye"; 27 }; 28 badLazyType = { 29 a = true; 30 }; 31 }; 32}