2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-26 07:34:11 +00:00
nixpkgs/doc/stdenv
Anderson Torres e671d3bbbd Nix docs: remove with lib; from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.

Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.

However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.

However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.

On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.

That being said, this patch removes most of example code in the current
documentation.

The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md

because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
2024-03-06 11:40:09 -03:00
..
cross-compilation.chapter.md
meta.chapter.md Nix docs: remove with lib; from example code 2024-03-06 11:40:09 -03:00
multiple-output.chapter.md remove the misleading warning on using nix-env for split outputs () 2023-09-25 16:23:01 +02:00
platform-notes.chapter.md stdenv: substituteStream: deprecate --replace in favor of --replace-{fail,warn,quiet} 2024-01-14 22:07:58 +01:00
stdenv.chapter.md Merge master into staging-next 2024-01-18 18:00:55 +00:00