Skip to content

Commit

Permalink
define "build"
Browse files Browse the repository at this point in the history
describing what we mean by building simplifies the definition of
a derivation (in the Nix language) to what it actually is: an attribute
set as produced by `derivation`.
  • Loading branch information
fricklerhandwerk committed Nov 18, 2022
1 parent b6814fd commit 4c94db9
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions doc/manual/src/glossary.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
# Glossary

- [derivation]{#gloss-derivation}\
A description of a build task. The result of a derivation is a
store object. Derivations are typically specified in Nix expressions
using the [`derivation` primitive](language/derivations.md). These are
translated into low-level *store derivations* (implicitly by
`nix-env` and `nix-build`, or explicitly by `nix-instantiate`).
A [build] task declared in the [Nix language](./language/index.md) using the built-in function [`derivation`](language/derivations.md).

[derivation]: #gloss-derivation

- [build]{#gloss-build}\
Produce a [store object].

See [`nix-build`](./command-ref/nix-build.md).

See [`nix build`](./command-ref/new-cli/nix3-build.md) (experimental).

Nix uses a two-stage build process:
A Nix expression that evaluates to a [derivation] is [instantiate]d to a [store derivation], which is then [realise]d to a [store object].

```
+--------------------+
| Nix language |
| .----------------. |
| | Nix expression | |
| '----------------' |
| | |
| evaluate |
| | | +------------------------+
| V | | Nix store |
| .------------. | | .------------------. |
| | derivation |---|-instantiate-|->| store derivation | |
| '------------' | | '------------------' |
+--------------------+ | | |
| realise |
| | |
| V |
| .--------------. |
| | store object | |
| '--------------' |
+------------------------+
```
[build]: #gloss-build
- [store derivation]{#gloss-store-derivation}\
A [derivation] represented as a `.drv` file in the [store].
It has a [store path], like any [store object].
Expand Down

0 comments on commit 4c94db9

Please sign in to comment.