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) - [`pkgs` itself](#pkgs-itself)
- [Derivations](#derivations) - [Derivations](#derivations)
- [Nix Idioms](#nix-idioms) - [Nix Idioms](#nix-idioms)
- [File lambdas](#file-lambdas)
- [`callPackage`](#callpackage)
- [Overrides / Overlays](#overrides--overlays)
<!-- markdown-toc end --> <!-- 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: at the same time as well as "inheritance" from other attribute sets:
```nix ```nix
inherit name age; # equivalent to `name = name; age = age;` {
inherit name age; # equivalent to `name = name; age = age;`
inherit (otherAttrs) email; # equivalent to `email = otherAttrs.email`; inherit (otherAttrs) email; # equivalent to `email = otherAttrs.email`;
}
``` ```
## `with` statements ## `with` statements