mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
doc: add "prefer lib over stdenv.lib" convention
I think we should have something in the manual people can point to about this, to avoid rehashing it over and over in PRs. "stdenv.lib" makes it look like lib is part of stdenv, which it isn't, and makes it even more confusing as a newcomer to figure out what stdenv is (and isn't).
This commit is contained in:
parent
f7c4e825aa
commit
c06b2b3d67
@ -178,6 +178,15 @@ args.stdenv.mkDerivation (args // {
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Prefer using the top-level <varname>lib</varname> over its alias
|
||||
<literal>stdenv.lib</literal>. <varname>lib</varname> is unrelated to
|
||||
<varname>stdenv</varname>, and so <literal>stdenv.lib</literal> should only
|
||||
be used as a convenience alias when developing to avoid having to modify
|
||||
the function inputs just to test something out.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-package-naming">
|
||||
|
Loading…
Reference in New Issue
Block a user