diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-09-16T12·13+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-09-16T12·13+0200 |
commit | f0ef6b74b93344798e44c6dc527f88a78b75a32f (patch) | |
tree | 8975a82b25a4410e2fc36e80cc042d74675396d7 /doc/manual/expressions/simple-expression.xml | |
parent | 67e5dd3ce9f46f810c06e16671e98f8e56b4e25c (diff) | |
parent | 8901acc97664aa8ebf687ee904428aa57a5192be (diff) |
Merge branch 'master' of github.com:thatdocslady/nix
Conflicts: doc/manual/release-notes.xml doc/manual/writing-nix-expressions.xml
Diffstat (limited to 'doc/manual/expressions/simple-expression.xml')
-rw-r--r-- | doc/manual/expressions/simple-expression.xml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/manual/expressions/simple-expression.xml b/doc/manual/expressions/simple-expression.xml new file mode 100644 index 000000000000..a8eb96f5a8e2 --- /dev/null +++ b/doc/manual/expressions/simple-expression.xml @@ -0,0 +1,47 @@ +<chapter xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="ch-simple-expression"> + +<title>Simple Nix Expression Use-Case</title> + +<para>This section shows how to add and test the <link +xlink:href='http://www.gnu.org/software/hello/hello.html'>GNU Hello +package</link> to the Nix Packages collection. Hello is a program +that prints out the text <quote>Hello, world!</quote>.</para> + +<para>To add a package to the Nix Packages collection, you generally +need to do three things: + +<orderedlist> + + <listitem><para>Write a Nix expression for the package. This is a + file that describes all the inputs involved in building the package, + such as dependencies, sources, and so on.</para></listitem> + + <listitem><para>Write a <emphasis>builder</emphasis>. This is a + shell script<footnote><para>In fact, it can be written in any + language, but typically it's a <command>bash</command> shell + script.</para></footnote> that actually builds the package from + the inputs.</para></listitem> + + <listitem><para>Add the package to the file + <filename>pkgs/top-level/all-packages.nix</filename>. The Nix + expression written in the first step is a + <emphasis>function</emphasis>; it requires other packages in order + to build it. In this step you put it all together, i.e., you call + the function with the right arguments to build the actual + package.</para></listitem> + +</orderedlist> + +</para> + +<xi:include href="expression-syntax.xml" /> +<xi:include href="build-script.xml" /> +<xi:include href="arguments-variables.xml" /> +<xi:include href="simple-building-testing.xml" /> +<xi:include href="generic-builder.xml" /> + +</chapter> \ No newline at end of file |