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.
This commit is contained in:
Vincent Ambo 2019-08-01 23:24:14 +01:00
parent bb02b01dd0
commit 8b325cd791

View file

@ -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