···956956 use = id;
957957 };
958958959959+ /* mkDerivedConfig : Option a -> (a -> Definition b) -> Definition b
960960+961961+ Create config definitions with the same priority as the definition of another option.
962962+ This should be used for option definitions where one option sets the value of another as a convenience.
963963+ For instance a config file could be set with a `text` or `source` option, where text translates to a `source`
964964+ value using `mkDerivedConfig options.text (pkgs.writeText "filename.conf")`.
965965+966966+ It takes care of setting the right priority using `mkOverride`.
967967+ */
968968+ # TODO: make the module system error message include information about `opt` in
969969+ # error messages about conflicts. E.g. introduce a variation of `mkOverride` which
970970+ # adds extra location context to the definition object. This will allow context to be added
971971+ # to all messages that report option locations "this value was derived from <full option name>
972972+ # which was defined in <locations>". It can provide a trace of options that contributed
973973+ # to definitions.
974974+ mkDerivedConfig = opt: f:
975975+ mkOverride
976976+ (opt.highestPrio or defaultPriority)
977977+ (f opt.value);
978978+959979 doRename = { from, to, visible, warn, use, withPriority ? true }:
960980 { config, options, ... }:
961981 let