mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
design -> architecture, add motivation
following ideas found in Architecture of Gazelle[1]
[1]: 56d35f8db0/Design.rst
This commit is contained in:
parent
d30033759a
commit
39f01176a7
14 changed files with 5 additions and 4 deletions
42
doc/manual/src/architecture/architecture.md
Normal file
42
doc/manual/src/architecture/architecture.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Architecture
|
||||
|
||||
This chapter describes how Nix works.
|
||||
It should help users understand why Nix behaves as it does, and it should help developers understand how to modify Nix and how to write similar tools.
|
||||
|
||||
## Overview
|
||||
|
||||
Nix consists of hierarchical [layers](https://en.m.wikipedia.org/wiki/Multitier_architecture#Layers).
|
||||
|
||||
```
|
||||
[ commmand line interface ]
|
||||
|
|
||||
| evaluates
|
||||
V
|
||||
[ configuration language ]
|
||||
|
|
||||
| evaluates to
|
||||
|
|
||||
reference V build
|
||||
[ build inputs ] --> [ build plans ] --> [ build results ]
|
||||
\ | /
|
||||
\ | persisted to /
|
||||
\ V /
|
||||
[ store ]
|
||||
```
|
||||
|
||||
At the top is the *command line interface*, translating from invocations of Nix executables to interactions with the underlying layers.
|
||||
|
||||
Below that is the *Nix language*, a [purely functional](https://en.m.wikipedia.org/wiki/Purely_functional_programming) configuration language.
|
||||
It is used to compose expressions which ultimately evaluate to self-contained *build steps*, used to derive *build results* from referenced *build inputs*.
|
||||
|
||||
::: {.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 derivation are just data.
|
||||
In practice this amounts to a set of files in a file system.
|
||||
:::
|
||||
|
||||
The command line and Nix language are what users interact with most.
|
||||
|
||||
Underlying everything is the *Nix store*, a mechanism to keep track of build plans, data, and references between them.
|
||||
It can also execute *build instructions*, captured in the build plans, to produce new data.
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue