1{ lib, config, ... }: 2let 3 inherit (lib) types; 4in 5{ 6 options = { 7 fun = lib.mkOption { 8 type = types.functionTo types.str; 9 }; 10 11 result = lib.mkOption { 12 type = types.str; 13 default = config.fun "input"; 14 }; 15 }; 16 17 config.fun = input: "input is ${input}"; 18}