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