From 3378a3bce8a5dc1282d901f7f3ec152676198092 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:07:18 +0200 Subject: [PATCH 01/17] add syntax overview from NixOS manual taken verbatim to keep track of required corrections. made it an HTML table to more easily change structure and keep diffs minimal. --- doc/manual/src/language/index.md | 306 +++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index c4b3abf75..6c355d923 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -11,3 +11,309 @@ packages, compositions of packages, and the variability within packages. This section presents the various features of the language. +# Syntax Summary + +Below is a summary of the most important syntactic constructs in the Nix +expression language. It's not complete. In particular, there are many +other built-in functions. See the [Nix +manual](https://nixos.org/nix/manual/#chap-writing-nix-expressions) for +the rest. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Example + + Description +
+ *Basic values* + + +
+ `"Hello world"` + + A string +
+ `"${pkgs.bash}/bin/sh"` + + A string containing an expression (expands to `"/nix/store/hash-bash-version/bin/sh"`) +
+ `true`, `false` + + Booleans +
+ `123` + + An integer +
+ `./foo.png` + + A path (relative to the containing Nix expression) +
+ *Compound values* + + +
+ `{ x = 1; y = 2; }` + + A set with attributes named `x` and `y` +
+ `{ foo.bar = 1; }` + + A nested set, equivalent to `{ foo = { bar = 1; }; }` +
+ `rec { x = "foo"; y = x + "bar"; }` + + A recursive set, equivalent to `{ x = "foo"; y = "foobar"; }` +
+ `[ "foo" "bar" ]` + + A list with two elements +
+ *Operators* + + +
+ `"foo" + "bar"` + + String concatenation +
+ `1 + 2` + + Integer addition +
+ `"foo" == "f" + "oo"` + + Equality test (evaluates to `true`) +
+ `"foo" != "bar"` + + Inequality test (evaluates to `true`) +
+ `!true` + + Boolean negation +
+ `{ x = 1; y = 2; }.x` + + Attribute selection (evaluates to `1`) +
+ `{ x = 1; y = 2; }.z or 3` + + Attribute selection with default (evaluates to `3`) +
+ `{ x = 1; y = 2; } // { z = 3; }` + + Merge two sets (attributes in the right-hand set taking precedence) +
+ *Control structures* + + +
+ `if 1 + 1 == 2 then "yes!" else "no!"` + + Conditional expression +
+ `assert 1 + 1 == 2; "yes!"` + + Assertion check (evaluates to `"yes!"`). See [](#sec-assertions) for using assertions in modules +
+ `let x = "foo"; y = "bar"; in x + y` + + Variable definition +
+ `with pkgs.lib; head [ 1 2 3 ]` + + Add all attributes from the given set to the scope (evaluates to `1`) +
+ *Functions (lambdas)* + + +
+ `x: x + 1` + + A function that expects an integer and returns it increased by 1 +
+ `(x: x + 1) 100` + + A function call (evaluates to 101) +
+ `let inc = x: x + 1; in inc (inc (inc 100))` + + A function bound to a variable and subsequently called by name (evaluates to 103) +
+ `{ x, y }: x + y` + + A function that expects a set with required attributes `x` and `y` and concatenates them +
+ `{ x, y ? "bar" }: x + y` + + A function that expects a set with required attribute `x` and optional `y`, using `"bar"` as default value for `y` +
+ `{ x, y, ... }: x + y` + + A function that expects a set with required attributes `x` and `y` and ignores any other attributes +
+ `{ x, y } @ args: x + y` + + A function that expects a set with required attributes `x` and `y`, and binds the whole set to `args` +
+ *Built-in functions* + + +
+ `import ./foo.nix` + + Load and return Nix expression in given file +
+ `map (x: x + x) [ 1 2 3 ]` + + Apply a function to every element of a list (evaluates to `[ 2 4 6 ]`) +
From 90836397d36080b097740fee587839e458763cf9 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:09:45 +0200 Subject: [PATCH 02/17] remove stale section link --- doc/manual/src/language/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 6c355d923..f22d66351 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -209,7 +209,7 @@ the rest. `assert 1 + 1 == 2; "yes!"` - Assertion check (evaluates to `"yes!"`). See [](#sec-assertions) for using assertions in modules + Assertion check (evaluates to `"yes!"`). From 43188d3d1818214fba6037af7ea3e87df5dfbdce Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:10:15 +0200 Subject: [PATCH 03/17] make hash and version distinguishable as placeholder --- doc/manual/src/language/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index f22d66351..41d20d835 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -49,7 +49,7 @@ the rest. `"${pkgs.bash}/bin/sh"` - A string containing an expression (expands to `"/nix/store/hash-bash-version/bin/sh"`) + A string containing an expression (expands to `"/nix/store/-bash-/bin/sh"`) From f165a8ae0874529f979a2bf33283300bb1ccdef4 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:10:48 +0200 Subject: [PATCH 04/17] flarify relative path semantics --- doc/manual/src/language/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 41d20d835..f601d1e16 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -73,7 +73,7 @@ the rest. `./foo.png` - A path (relative to the containing Nix expression) + A path relative to the file containing this Nix expression From 292cab039d7c2d1dc2e67f74a92dbf4953430935 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:16:13 +0200 Subject: [PATCH 05/17] add multi-line string --- doc/manual/src/language/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index f601d1e16..8241cd0cd 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -43,6 +43,18 @@ the rest. A string + + ``` + '' + multi + line + string + '' + ``` + + + A multiline string. Strips common prefixed whitespace. Evaluates to `"multi\n line\n string"`. + From e6f7c180de3553dbb4ebd3969f5da4423dafc4bd Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:18:59 +0200 Subject: [PATCH 06/17] add floating point number --- doc/manual/src/language/index.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 8241cd0cd..e623bc540 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -53,7 +53,7 @@ the rest. ``` - A multiline string. Strips common prefixed whitespace. Evaluates to `"multi\n line\n string"`. + A multi-line string. Strips common prefixed whitespace. Evaluates to `"multi\n line\n string"`. @@ -80,6 +80,14 @@ the rest. An integer + + + `3.141` + + + A floating point number + + `./foo.png` From 21438acc70575134e6d17e280f5172dc2bec971f Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:20:32 +0200 Subject: [PATCH 07/17] add absolute path --- doc/manual/src/language/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index e623bc540..b4ffe171b 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -88,6 +88,14 @@ the rest. A floating point number + + + `/etc` + + + An absolute path + + `./foo.png` From 587ae9ada5e1a94184772542352df85549f0ce99 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:22:41 +0200 Subject: [PATCH 08/17] add search path --- doc/manual/src/language/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index b4ffe171b..3ed00d8e3 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -104,6 +104,14 @@ the rest. A path relative to the file containing this Nix expression + + + + + + Search path. Value determined by [`$NIX_PATH` environment variable](../command-ref/env-common.md#env-NIX_PATH). + + *Compound values* From 391fd10b12b00a3f61b178811fdecda7308e5193 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:25:40 +0200 Subject: [PATCH 09/17] add home path --- doc/manual/src/language/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 3ed00d8e3..5ad235819 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -104,6 +104,14 @@ the rest. A path relative to the file containing this Nix expression + + + `~/.config` + + + A home path. Evaluates to the `"/.config"`. + + From 5c25bdee509af297caddd7b6fdca275940282269 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 13:26:11 +0200 Subject: [PATCH 10/17] add null --- doc/manual/src/language/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 5ad235819..bc20f4316 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -72,6 +72,14 @@ the rest. Booleans + + + `null` + + + Null value + + `123` From 2e4704ca9372c90826022d52360b6d57b564de5b Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 14:13:03 +0200 Subject: [PATCH 11/17] add second @ pattern example --- doc/manual/src/language/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index bc20f4316..f201bbded 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -339,6 +339,8 @@ the rest. `{ x, y } @ args: x + y` + + `args @ { x, y }: x + y` A function that expects a set with required attributes `x` and `y`, and binds the whole set to `args` From 0378531bf2cdb19ab4601c6dbc04c3f2cd962caa Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 14:13:15 +0200 Subject: [PATCH 12/17] add curried function --- doc/manual/src/language/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index f201bbded..72e09b25d 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -296,6 +296,14 @@ the rest. A function that expects an integer and returns it increased by 1 + + + `x: y: x + y` + + + Curried function, equivalent to `x: (y: x + y)`. Can be used like a function that takes two arguments and returns their sum. + + `(x: x + 1) 100` From c209e6e108c95ba657992b208ce12af665eed9d4 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 14:13:36 +0200 Subject: [PATCH 13/17] add more list examples --- doc/manual/src/language/index.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 72e09b25d..65463baa0 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -162,10 +162,14 @@ the rest. - `[ "foo" "bar" ]` + `[ "foo" "bar" "baz" ]` + + `[ 1 2 3 ]` + + `[ (f 1) { a = 1; b = 2; } [ "c" ] ]` - A list with two elements + Lists with three elements. From 6ba8d6dc82f2b44734f5760225435642ae842725 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 12 Aug 2022 14:27:03 +0200 Subject: [PATCH 14/17] add more examples on string interpolation --- doc/manual/src/language/index.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 65463baa0..724484460 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -38,7 +38,7 @@ the rest. - `"Hello world"` + `"hello world"` A string @@ -58,10 +58,14 @@ the rest. + `"hello ${ { a = "world" }.a }"` + + `"1 2 ${3}"` + `"${pkgs.bash}/bin/sh"` - A string containing an expression (expands to `"/nix/store/-bash-/bin/sh"`) + String interpolation (expands to `"hello world"`, `"1 2 3"`, `"/nix/store/-bash-/bin/sh"`) From bc315326fa70876444cc7bc791a02e619f46304e Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Mon, 15 Aug 2022 11:12:41 +0200 Subject: [PATCH 15/17] fix whitespace to please markdown keep some indentation to ease source readability --- doc/manual/src/language/index.md | 886 ++++++++++++++++++------------- 1 file changed, 531 insertions(+), 355 deletions(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index 724484460..cc71c3143 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -20,370 +20,546 @@ manual](https://nixos.org/nix/manual/#chap-writing-nix-expressions) for the rest. - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- Example - - Description -
- *Basic values* - +
+ Example + + Description +
-
- `"hello world"` - - A string - - ``` - '' - multi - line - string - '' - ``` - - A multi-line string. Strips common prefixed whitespace. Evaluates to `"multi\n line\n string"`. -
- `"hello ${ { a = "world" }.a }"` - `"1 2 ${3}"` + *Basic values* - `"${pkgs.bash}/bin/sh"` - - String interpolation (expands to `"hello world"`, `"1 2 3"`, `"/nix/store/-bash-/bin/sh"`) -
- `true`, `false` - - Booleans -
- `null` - - Null value -
- `123` - - An integer -
- `3.141` - - A floating point number -
- `/etc` - - An absolute path -
- `./foo.png` - - A path relative to the file containing this Nix expression -
- `~/.config` - - A home path. Evaluates to the `"/.config"`. -
- - - Search path. Value determined by [`$NIX_PATH` environment variable](../command-ref/env-common.md#env-NIX_PATH). -
- *Compound values* - -
- `{ x = 1; y = 2; }` - - A set with attributes named `x` and `y` -
- `{ foo.bar = 1; }` - - A nested set, equivalent to `{ foo = { bar = 1; }; }` -
- `rec { x = "foo"; y = x + "bar"; }` - - A recursive set, equivalent to `{ x = "foo"; y = "foobar"; }` -
- `[ "foo" "bar" "baz" ]` + - `[ 1 2 3 ]` - `[ (f 1) { a = 1; b = 2; } [ "c" ] ]` - - Lists with three elements. -
- *Operators* - -
- `"foo" + "bar"` - - String concatenation -
- `1 + 2` - - Integer addition -
- `"foo" == "f" + "oo"` - - Equality test (evaluates to `true`) -
- `"foo" != "bar"` - - Inequality test (evaluates to `true`) -
- `!true` - - Boolean negation -
- `{ x = 1; y = 2; }.x` - - Attribute selection (evaluates to `1`) -
- `{ x = 1; y = 2; }.z or 3` - - Attribute selection with default (evaluates to `3`) -
- `{ x = 1; y = 2; } // { z = 3; }` - - Merge two sets (attributes in the right-hand set taking precedence) -
- *Control structures* - +
-
- `if 1 + 1 == 2 then "yes!" else "no!"` - - Conditional expression -
- `assert 1 + 1 == 2; "yes!"` - - Assertion check (evaluates to `"yes!"`). -
- `let x = "foo"; y = "bar"; in x + y` - - Variable definition -
- `with pkgs.lib; head [ 1 2 3 ]` - - Add all attributes from the given set to the scope (evaluates to `1`) -
- *Functions (lambdas)* - + `"hello world"` -
- `x: x + 1` - - A function that expects an integer and returns it increased by 1 -
- `x: y: x + y` - - Curried function, equivalent to `x: (y: x + y)`. Can be used like a function that takes two arguments and returns their sum. -
- `(x: x + 1) 100` - - A function call (evaluates to 101) -
- `let inc = x: x + 1; in inc (inc (inc 100))` - - A function bound to a variable and subsequently called by name (evaluates to 103) -
- `{ x, y }: x + y` - - A function that expects a set with required attributes `x` and `y` and concatenates them -
- `{ x, y ? "bar" }: x + y` - - A function that expects a set with required attribute `x` and optional `y`, using `"bar"` as default value for `y` -
- `{ x, y, ... }: x + y` - - A function that expects a set with required attributes `x` and `y` and ignores any other attributes -
- `{ x, y } @ args: x + y` + - `args @ { x, y }: x + y` - - A function that expects a set with required attributes `x` and `y`, and binds the whole set to `args` -
- *Built-in functions* - + A string -
- `import ./foo.nix` - - Load and return Nix expression in given file -
- `map (x: x + x) [ 1 2 3 ]` - - Apply a function to every element of a list (evaluates to `[ 2 4 6 ]`) -
+ + ``` + '' + multi + line + string + '' + ``` + + + + A multi-line string. Strips common prefixed whitespace. Evaluates to `"multi\n line\n string"`. + +
+ + `"hello ${ { a = "world" }.a }"` + + `"1 2 ${3}"` + + `"${pkgs.bash}/bin/sh"` + + + + String interpolation (expands to `"hello world"`, `"1 2 3"`, `"/nix/store/-bash-/bin/sh"`) + +
+ + `true`, `false` + + + + Booleans + +
+ + `null` + + + + Null value + +
+ + `123` + + + + An integer + +
+ + `3.141` + + + + A floating point number + +
+ + `/etc` + + + + An absolute path + +
+ + `./foo.png` + + + + A path relative to the file containing this Nix expression + +
+ + `~/.config` + + + + A home path. Evaluates to the `"/.config"`. + +
+ + + + + + Search path. Value determined by [`$NIX_PATH` environment variable](../command-ref/env-common.md#env-NIX_PATH). + +
+ + *Compound values* + + + + + +
+ + `{ x = 1; y = 2; }` + + + + A set with attributes named `x` and `y` + +
+ + `{ foo.bar = 1; }` + + + + A nested set, equivalent to `{ foo = { bar = 1; }; }` + +
+ + `rec { x = "foo"; y = x + "bar"; }` + + + + A recursive set, equivalent to `{ x = "foo"; y = "foobar"; }` + +
+ + `[ "foo" "bar" "baz" ]` + + `[ 1 2 3 ]` + + `[ (f 1) { a = 1; b = 2; } [ "c" ] ]` + + + + Lists with three elements. + +
+ + *Operators* + + + + + +
+ + `"foo" + "bar"` + + + + String concatenation + +
+ + `1 + 2` + + + + Integer addition + +
+ + `"foo" == "f" + "oo"` + + + + Equality test (evaluates to `true`) + +
+ + `"foo" != "bar"` + + + + Inequality test (evaluates to `true`) + +
+ + `!true` + + + + Boolean negation + +
+ + `{ x = 1; y = 2; }.x` + + + + Attribute selection (evaluates to `1`) + +
+ + `{ x = 1; y = 2; }.z or 3` + + + + Attribute selection with default (evaluates to `3`) + +
+ + `{ x = 1; y = 2; } // { z = 3; }` + + + + Merge two sets (attributes in the right-hand set taking precedence) + +
+ + *Control structures* + + + + + +
+ + `if 1 + 1 == 2 then "yes!" else "no!"` + + + + Conditional expression + +
+ + `assert 1 + 1 == 2; "yes!"` + + + + Assertion check (evaluates to `"yes!"`). + +
+ + `let x = "foo"; y = "bar"; in x + y` + + + + Variable definition + +
+ + `with pkgs.lib; head [ 1 2 3 ]` + + + + Add all attributes from the given set to the scope (evaluates to `1`) + +
+ + *Functions (lambdas)* + + + + + +
+ + `x: x + 1` + + + + A function that expects an integer and returns it increased by 1 + +
+ + `x: y: x + y` + + + + Curried function, equivalent to `x: (y: x + y)`. Can be used like a function that takes two arguments and returns their sum. + +
+ + `(x: x + 1) 100` + + + + A function call (evaluates to 101) + +
+ + `let inc = x: x + 1; in inc (inc (inc 100))` + + + + A function bound to a variable and subsequently called by name (evaluates to 103) + +
+ + `{ x, y }: x + y` + + + + A function that expects a set with required attributes `x` and `y` and concatenates them + +
+ + `{ x, y ? "bar" }: x + y` + + + + A function that expects a set with required attribute `x` and optional `y`, using `"bar"` as default value for `y` + +
+ + `{ x, y, ... }: x + y` + + + + A function that expects a set with required attributes `x` and `y` and ignores any other attributes + +
+ + `{ x, y } @ args: x + y` + + `args @ { x, y }: x + y` + + + + A function that expects a set with required attributes `x` and `y`, and binds the whole set to `args` + +
+ + *Built-in functions* + + + + + +
+ + `import ./foo.nix` + + + + Load and return Nix expression in given file + +
+ + `map (x: x + x) [ 1 2 3 ]` + + + + Apply a function to every element of a list (evaluates to `[ 2 4 6 ]`) + +
From 71e9c2869429bb711bf728f4a7acd14f5c2e1eeb Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Mon, 15 Aug 2022 11:15:03 +0200 Subject: [PATCH 16/17] reword introduction to overview --- doc/manual/src/language/index.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index cc71c3143..cea17bedc 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -11,13 +11,9 @@ packages, compositions of packages, and the variability within packages. This section presents the various features of the language. -# Syntax Summary +# Overview -Below is a summary of the most important syntactic constructs in the Nix -expression language. It's not complete. In particular, there are many -other built-in functions. See the [Nix -manual](https://nixos.org/nix/manual/#chap-writing-nix-expressions) for -the rest. +This is an incomplete overview of language features, by example. From f35b3aa47bc6edc2a929e1803c8429113c34012b Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Wed, 24 Aug 2022 08:48:34 +0200 Subject: [PATCH 17/17] do not use unwarranted pkgs in example --- doc/manual/src/language/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/src/language/index.md b/doc/manual/src/language/index.md index cea17bedc..83484dced 100644 --- a/doc/manual/src/language/index.md +++ b/doc/manual/src/language/index.md @@ -403,7 +403,7 @@ This is an incomplete overview of language features, by example.
- `with pkgs.lib; head [ 1 2 3 ]` + `with builtins; head [ 1 2 3 ]`