docs: add inherit to language overview (#10194)

* docs: add inherit to language overview

Adds a short summary about `inherit` to the language overview.
This commit is contained in:
Jonathan Dickinson
2024-03-08 09:24:44 -05:00
committed by GitHub
parent ef5cb44608
commit 1ffcbddf62

View File

@@ -432,6 +432,32 @@ This is an incomplete overview of language features, by example.
</td>
</tr>
<tr>
<td>
`inherit pkgs src;`
</td>
<td>
Adds the variables to the current scope (attribute set or `let` binding).
Desugars to `pkgs = pkgs; src = src;`
</td>
</tr>
<tr>
<td>
`inherit (pkgs) lib stdenv;`
</td>
<td>
Adds the attributes, from the attribute set in parentheses, to the current scope (attribute set or `let` binding).
Desugars to `lib = pkgs.lib; stdenv = pkgs.stdenv;`
</td>
</tr>
<tr>
<td>