aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/src/expressions/simple-expression.md
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-15 14:08:35 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-15 14:08:35 +0000
commitc08c9f08c75bf379439348cccb5b8871a27bf498 (patch)
treec4a7276366b31047b9f437865bebe21a919382af /doc/manual/src/expressions/simple-expression.md
parent3df78858f2ad91a80e30ba910119a0c16c05c66a (diff)
parent733d2e9402807e54d503c3113e854bfddb3d44e0 (diff)
Merge remote-tracking branch 'upstream/master' into remove-storetype-delegate-regStore
Diffstat (limited to 'doc/manual/src/expressions/simple-expression.md')
-rw-r--r--doc/manual/src/expressions/simple-expression.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/manual/src/expressions/simple-expression.md b/doc/manual/src/expressions/simple-expression.md
new file mode 100644
index 000000000..857f71b9b
--- /dev/null
+++ b/doc/manual/src/expressions/simple-expression.md
@@ -0,0 +1,23 @@
+# A Simple Nix Expression
+
+This section shows how to add and test the [GNU Hello
+package](http://www.gnu.org/software/hello/hello.html) to the Nix
+Packages collection. Hello is a program that prints out the text “Hello,
+world\!”.
+
+To add a package to the Nix Packages collection, you generally need to
+do three things:
+
+1. 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.
+
+2. Write a *builder*. This is a shell script that builds the package
+ from the inputs. (In fact, it can be written in any language, but
+ typically it's a `bash` shell script.)
+
+3. Add the package to the file `pkgs/top-level/all-packages.nix`. The
+ Nix expression written in the first step is a *function*; 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.