Skip to content

Advanced options #257300

@roberth

Description

@roberth

Project description

Add a new optional attribute to mkOption called advanced, which indicates options that are not needed in a typical configuration.

Context

Simple is good, but real life gets a vote. As modules gain users, their needs need to be met, and every now and then, that means adding options to cover their use cases peculiarities.
However, large numbers of options make the documentation harder to navigate. While a new module's options are often understood at a glance, the same can not be said for a module with 30 options.
In such cases, and even at a smaller scale, it would be helpful to provide hints which options are relevant to most users, as opposed to which ones only exist to support rather specific use cases, or which are consumed mostly by other modules rather than user configuration.

Implementation

  • Add the advanced flag to mkOption. Options are not advanced by default.

Future work

  • Highlight non-advanced options in NixOS search
  • Bias the NixOS search to prefer non-advanced options (to a small degree)
  • Add a marker to advanced options in generated markdown docs

Maintainers

@infinisil @roberth

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: documentationMeta-discussion about documentation and its workflow6.topic: module systemAbout "NixOS" module system internals

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions