Skip to content

Commit

Permalink
doc: add "prefer lib over stdenv.lib" convention
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
alyssais authored and Profpatsch committed Jan 10, 2021
1 parent f7c4e82 commit c06b2b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/contributing/coding-conventions.xml
Expand Up @@ -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">
Expand Down

0 comments on commit c06b2b3

Please sign in to comment.