Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d035c0d

Browse files
committedJan 13, 2024
chore: update docs
1 parent 94add6b commit d035c0d

File tree

1 file changed

+71
-15
lines changed

1 file changed

+71
-15
lines changed
 

‎docs/src/modules_schema.md

+71-15
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Add commands to the environment.
6161
```
6262

6363

64-
**Type**: list of (submodule)
64+
**Type**: list of ((package or string convertible to it) or (list with two elements of types: [ string (package or string convertible to it) ]) or (flatOptions))
6565

6666
**Example value**:
6767
```nix
@@ -72,7 +72,23 @@ Add commands to the environment.
7272
Declared in:
7373
* [modules/commands.nix](https://github.com/numtide/devshell/tree/main/modules/commands.nix)
7474

75-
## `commands.*.package`
75+
## `commands.*`
76+
77+
A config for a command when the `commands` option is a list.
78+
79+
80+
**Type**: (package or string convertible to it) or (list with two elements of types: [ string (package or string convertible to it) ]) or (flatOptions)
81+
82+
**Example value**:
83+
```nix
84+
{"_type":"literalExpression","text":"[\n {\n category = \"scripts\";\n package = \"black\";\n }\n [ \"[package] print hello\" \"hello\" ]\n \"nodePackages.yarn\"\n]\n"}
85+
```
86+
87+
88+
Declared in:
89+
* [nix/commands/types.nix](https://github.com/numtide/devshell/tree/main/nix/commands/types.nix)
90+
91+
## `commands.*.package (flatOptions)`
7692

7793
Used to bring in a specific package. This package will be added to the
7894
environment.
@@ -84,15 +100,15 @@ environment.
84100
```
85101

86102

87-
**Type**: null or (package or string convertible to it)
103+
**Type**: null or (package or string convertible to it) or package
88104

89105
Declared in:
90-
* [modules/commands.nix](https://github.com/numtide/devshell/tree/main/modules/commands.nix)
106+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
91107

92-
## `commands.*.category`
108+
## `commands.*.category (flatOptions)`
93109

94-
Set a free text category under which this command is grouped
95-
and shown in the help menu.
110+
Sets a free text category under which this command is grouped
111+
and shown in the devshell menu.
96112

97113

98114
**Default value**:
@@ -104,9 +120,9 @@ and shown in the help menu.
104120
**Type**: string
105121

106122
Declared in:
107-
* [modules/commands.nix](https://github.com/numtide/devshell/tree/main/modules/commands.nix)
123+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
108124

109-
## `commands.*.command`
125+
## `commands.*.command (flatOptions)`
110126

111127
If defined, it will add a script with the name of the command, and the
112128
content of this value.
@@ -130,9 +146,29 @@ provided.
130146

131147

132148
Declared in:
133-
* [modules/commands.nix](https://github.com/numtide/devshell/tree/main/modules/commands.nix)
149+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
150+
151+
## `commands.*.expose (flatOptions)`
152+
153+
When `true`, the `command (flatOptions)`
154+
or the `package (flatOptions)` will be added to the environment.
155+
156+
Otherwise, they will not be added to the environment, but will be printed
157+
in the devshell menu.
158+
159+
160+
**Default value**:
161+
```nix
162+
{"_type":"literalExpression","text":"true"}
163+
```
134164

135-
## `commands.*.help`
165+
166+
**Type**: boolean
167+
168+
Declared in:
169+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
170+
171+
## `commands.*.help (flatOptions)`
136172

137173
Describes what the command does in one line of text.
138174

@@ -146,11 +182,15 @@ Describes what the command does in one line of text.
146182
**Type**: null or string
147183

148184
Declared in:
149-
* [modules/commands.nix](https://github.com/numtide/devshell/tree/main/modules/commands.nix)
185+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
150186

151-
## `commands.*.name`
187+
## `commands.*.name (flatOptions)`
152188

153-
Name of this command. Defaults to attribute name in commands.
189+
Name of this command.
190+
191+
Defaults to a `package (flatOptions)` name or pname if present.
192+
193+
The value of this option is required for a `command (flatOptions)`.
154194

155195

156196
**Default value**:
@@ -162,7 +202,23 @@ Name of this command. Defaults to attribute name in commands.
162202
**Type**: null or string
163203

164204
Declared in:
165-
* [modules/commands.nix](https://github.com/numtide/devshell/tree/main/modules/commands.nix)
205+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
206+
207+
## `commands.*.prefix (flatOptions)`
208+
209+
Prefix of the command name in the devshell menu.
210+
211+
212+
**Default value**:
213+
```nix
214+
{"_type":"literalExpression","text":"\"\""}
215+
```
216+
217+
218+
**Type**: string
219+
220+
Declared in:
221+
* [nix/commands/flatOptions.nix](https://github.com/numtide/devshell/tree/main/nix/commands/flatOptions.nix)
166222

167223
## `devshell.packages`
168224

0 commit comments

Comments
 (0)
Please sign in to comment.