at 23.11-beta 500 B view raw
1{ lib, config, ... }: 2let 3 inherit (lib) types; 4in { 5 options = { 6 fun = lib.mkOption { 7 type = types.functionTo (types.attrsOf types.str); 8 }; 9 10 result = lib.mkOption { 11 type = types.str; 12 default = toString (lib.attrValues (config.fun { 13 a = "a"; 14 b = "b"; 15 c = "c"; 16 })); 17 }; 18 }; 19 20 config.fun = lib.mkMerge [ 21 (input: { inherit (input) a; }) 22 (input: { inherit (input) b; }) 23 (input: { 24 b = lib.mkForce input.c; 25 }) 26 ]; 27}