From 1ffcbddf62824475257da2e58b2047e87f5287c8 Mon Sep 17 00:00:00 2001 From: Jonathan Dickinson Date: Fri, 8 Mar 2024 09:24:44 -0500 Subject: [PATCH] docs: add inherit to language overview (#10194) * docs: add inherit to language overview Adds a short summary about `inherit` to the language overview. --- doc/manual/src/language/index.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index a26e43a05..5388c6dc4 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -432,6 +432,32 @@ This is an incomplete overview of language features, by example. + + + + `inherit pkgs src;` + + + + + Adds the variables to the current scope (attribute set or `let` binding). + Desugars to `pkgs = pkgs; src = src;` + + + + + + + `inherit (pkgs) lib stdenv;` + + + + + 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;` + + +