Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ rec {
isOption = lib.isType "option";

/**
Creates an Option attribute set. `mkOption` accepts an attribute set with the following keys:
Creates an Option declaration for use with the module system.

# Inputs

Structured attribute set
: Attribute set containing none or some of the following attributes.
Attribute set
: containing none or some of the following attributes.

`default`
: Optional default value used when no definition is given in the configuration.
Expand Down Expand Up @@ -122,16 +122,16 @@ rec {
`readOnly`
: Optional boolean indicating whether the option can be set only once.

`...` (any other attribute)
: Any other attribute is passed through to the resulting option attribute set.

# Examples
:::{.example}
## `lib.options.mkOption` usage example

```nix
mkOption { } // => { _type = "option"; }
mkOption { default = "foo"; } // => { _type = "option"; default = "foo"; }
mkOption { }
# => Empty option; type = types.anything

mkOption { default = "foo"; }
# => Same as above, with a default value
```

:::
Expand Down
Loading