From 8b325cd791c0d0e85d218557666aa25381ceafcf Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Aug 2019 23:24:14 +0100 Subject: [PATCH] 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. --- nix/nix-1p/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nix/nix-1p/README.md b/nix/nix-1p/README.md index 665a49d9d..620fe6138 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) @@ -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