diff options
author | Domen Kožar <domen@dev.si> | 2014-03-04 23:41:35 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2014-03-04 23:41:35 +0100 |
commit | 5d9040ee6bd3752a4f2f8d4dccb54fa91d05457f (patch) | |
tree | 3d9d0a727a2e996150b60add7025ce045e75172f /doc | |
parent | c824acb84c6adb2fccf923cdf2b3af9e4ed3bef1 (diff) | |
parent | 1efb6e65d24c7139d8036c8ea67c93b72ce49c38 (diff) |
Merge pull request #1815 from vcunat/p/doc-package-naming
doc: document current conventions on package naming
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coding-conventions.xml | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml index e55f86ae3d31f..61d373738f900 100644 --- a/doc/coding-conventions.xml +++ b/doc/coding-conventions.xml @@ -235,12 +235,7 @@ Most of the time, these are the same. For instance, the package bound to the variable name <varname>e2fsprogs</varname> in <filename>all-packages.nix</filename>, and the Nix expression is in <filename>pkgs/os-specific/linux/e2fsprogs/default.nix</filename>. -However, identifiers in the Nix language don’t allow certain -characters (e.g. dashes), so sometimes a different variable name -should be used. For instance, the -<literal>module-init-tools</literal> package is bound to the -<literal>module_init_tools</literal> variable in -<filename>all-packages.nix</filename>.</para> +</para> <para>There are a few naming guidelines: @@ -261,17 +256,20 @@ should be used. For instance, the a package named <literal>hello-svn</literal> by <command>nix-env</command>.</para></listitem> - <listitem><para>Dashes in the package name should be changed to - underscores in variable names, rather than to camel case — e.g., - <varname>module_init_tools</varname> instead of - <varname>moduleInitTools</varname>.</para></listitem> + <listitem><para>Dashes in the package name should be preserved + in new variable names, rather than converted to underscores + (which was convention up to around 2013 and most names + still have underscores instead of dashes) — e.g., + <varname>http-parser</varname> instead of + <varname>http_parser</varname>.</para></listitem> <listitem><para>If there are multiple versions of a package, this should be reflected in the variable names in <filename>all-packages.nix</filename>, - e.g. <varname>hello_0_3</varname> and <varname>hello_0_4</varname>. + e.g. <varname>json-c-0-9</varname> and <varname>json-c-0-11</varname>. If there is an obvious “default” version, make an attribute like - <literal>hello = hello_0_4;</literal>.</para></listitem> + <literal>json-c = json-c-0-9;</literal>. + See also <xref linkend="sec-versioning" /></para></listitem> </itemizedlist> @@ -288,7 +286,7 @@ dashes between words — not in camel case. For instance, it should be <filename>allPackages.nix</filename> or <filename>AllPackages.nix</filename>.</para> -<section><title>Hierachy</title> +<section><title>Hierarchy</title> <para>Each package should be stored in its own directory somewhere in the <filename>pkgs/</filename> tree, i.e. in @@ -567,7 +565,7 @@ splitting up an existing category.</para> </section> -<section><title>Versioning</title> +<section xml:id="sec-versioning"><title>Versioning</title> <para>Because every version of a package in Nixpkgs creates a potential maintenance burden, old versions of a package should not be |