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