diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-01-09 07:04:48 +0000 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2021-01-10 08:24:52 +0100 |
commit | c06b2b3d671da4847f950e7e9041920b40eca0bf (patch) | |
tree | b114202e02fe96b4a81f3898499380caaf61eb36 /doc | |
parent | f7c4e825aa9d63da269ff767aebb6b2c3324d7f9 (diff) |
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).
Diffstat (limited to 'doc')
-rw-r--r-- | doc/contributing/coding-conventions.xml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/contributing/coding-conventions.xml b/doc/contributing/coding-conventions.xml index e587275a6383..cb6d60c2c138 100644 --- a/doc/contributing/coding-conventions.xml +++ b/doc/contributing/coding-conventions.xml @@ -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"> |