Home Explore Blog CI



nix

2nd chunk of `doc/manual/source/architecture/architecture.md`
84a03790bea6535c78c7b94a50dce16f2bb611e36720cdcb0000000100000f70
                                                    |
                                                    V
                                            .---------------.
                                            |     file      |
                                            '---------------'
```

At the top is the [command line interface](../command-ref/index.md) that drives the underlying layers.

The [Nix language](../language/index.md) evaluator transforms Nix expressions into self-contained *build plans*, which are used to derive *build results* from referenced *build inputs*.

The command line interface and Nix expressions are what users deal with most.

> **Note**
>
> The Nix language itself does not have a notion of *packages* or *configurations*.
> As far as we are concerned here, the inputs and results of a build plan are just data.

Underlying the command line interface and the Nix language evaluator is the [Nix store](../store/index.md), a mechanism to keep track of build plans, data, and references between them.
It can also execute build plans to produce new data, which are made available to the operating system as files.

A build plan itself is a series of *build tasks*, together with their build inputs.

> **Important**
> A build task in Nix is called [store derivation](@docroot@/glossary.md#gloss-store-derivation).

Each build task has a special build input executed as *build instructions* in order to perform the build.
The result of a build task can be input to another build task.

The following [data flow diagram] shows a build plan for illustration.
Build inputs used as instructions to a build task are marked accordingly:


```
+--------------------------------------------------------------------+
| build plan                                                         |
|                                                                    |
| .-------------.                                                    |
| | build input |---------.                                          |
| '-------------'         |                                          |
|                    instructions                                    |
|                         |                                          |
|                         v                                          |
| .-------------.    .----------.                                    |
| | build input |-->( build task )-------.                           |
| '-------------'    '----------'        |                           |
|                                  instructions                      |
|                                        |                           |
|                                        v                           |
| .-------------.                  .----------.     .--------------. |
| | build input |---------.       ( build task )--->| build result | |
| '-------------'         |        '----------'     '--------------' |
|                    instructions        ^                           |
|                         |              |                           |
|                         v              |                           |
| .-------------.    .----------.        |                           |
| | build input |-->( build task )-------'                           |
| '-------------'    '----------'                                    |
|                         ^                                          |
|                         |                                          |
|                         |                                          |
| .-------------.         |                                          |
| | build input |---------'                                          |
| '-------------'                                                    |
|                                                                    |
+--------------------------------------------------------------------+
```


Title: Build Plans and Tasks
Summary
The command line interface drives Nix, using the Nix language evaluator to transform expressions into build plans that derive results from inputs. The Nix store tracks plans, data, and references, executing plans to produce files. Build plans consist of build tasks, each with inputs and instructions. Build task in Nix is called store derivation.