1 # Check that AttrsWith { lazy = true; } is lazy
4 inherit (lib) types mkOption;
6 lazyAttrsOf = mkOption {
8 type = types.attrsWith {
16 type = types.attrsWith {
27 options.mergedLazyLazy = lazyAttrsOf;
28 options.mergedLazyNonLazy = lazyAttrsOf;
29 options.mergedNonLazyNonLazy = attrsOf;
36 options.mergedLazyLazy = lazyAttrsOf;
37 options.mergedLazyNonLazy = attrsOf;
38 options.mergedNonLazyNonLazy = attrsOf;
45 # Can only evaluate if lazy
46 config.mergedLazyLazy.bar = config.mergedLazyLazy.baz + 1;
47 config.mergedLazyLazy.baz = 10;
48 options.lazyResult = mkOption { default = config.mergedLazyLazy.bar; };
50 # Can not only evaluate if not lazy
51 config.mergedNonLazyNonLazy.bar = config.mergedNonLazyNonLazy.baz + 1;
52 config.mergedNonLazyNonLazy.baz = 10;
53 options.nonLazyResult = mkOption { default = config.mergedNonLazyNonLazy.bar; };