about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-08-01T22·24+0100
committerVincent Ambo <tazjin@google.com>2019-08-01T22·24+0100
commit8b325cd791c0d0e85d218557666aa25381ceafcf (patch)
tree2b196285268accef1531e93b1cf67655d6361ff8 /nix
parentbb02b01dd0ea2426c6d77fe3cc6d1f85b58b7460 (diff)
Make Github's Nix highlighter happy
The highlighter expects that all code blocks are valid expressions (to
some degree) and highlights mismatches in dark red, which is not
particularly pleasant for the reader.

This introduces a "fake" attribute set in the `inherit` section to
please the highlighter.
Diffstat (limited to 'nix')
-rw-r--r--nix/nix-1p/README.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/nix/nix-1p/README.md b/nix/nix-1p/README.md
index 665a49d9dd74..620fe613853c 100644
--- a/nix/nix-1p/README.md
+++ b/nix/nix-1p/README.md
@@ -29,6 +29,9 @@ important is missing.
     - [`pkgs` itself](#pkgs-itself)
 - [Derivations](#derivations)
 - [Nix Idioms](#nix-idioms)
+    - [File lambdas](#file-lambdas)
+    - [`callPackage`](#callpackage)
+    - [Overrides / Overlays](#overrides--overlays)
 
 <!-- markdown-toc end -->
 
@@ -253,9 +256,10 @@ This is often convenient, especially because inherit supports multiple variables
 at the same time as well as "inheritance" from other attribute sets:
 
 ```nix
-inherit name age; # equivalent to `name = name; age = age;`
-
-inherit (otherAttrs) email; # equivalent to `email = otherAttrs.email`;
+{
+  inherit name age; # equivalent to `name = name; age = age;`
+  inherit (otherAttrs) email; # equivalent to `email = otherAttrs.email`;
+}
 ```
 
 ## `with` statements