query
On this page

renderOptionValue

lib.options.renderOptionValue

Docs pulled from | This Revision | 10 minutes ago


Ensures that the given option value (default or example) is a _typed string by rendering Nix values to literalExpressions.

Inputs

v

1. Function argument


Noogle detected

Implementation

The following is the current implementation of this function.

renderOptionValue =
    v:
    if v ? _type && v ? text then
      v
    else
      literalExpression (
        lib.generators.toPretty {
          multiline = true;
          allowPrettyValues = true;
        } v
      );