Skip to content

nix

Nix Store

Nix

Nix Store

Nix Store

The Nix store is an abstraction to store immutable file system data (such as software packages) that can have dependencies on other such data.

Concretely, albeit using concepts that are only defined in the rest of the chapter, a store consists of:

  • A set of store objects, the immutable file system data.

    This can also be looked at as a map from store paths to store objects.

  • A set of derivations, instructions for building store objects.

    This can also be looked at as a map from store paths to derivations. Since store paths to derivations always end in .drv, and store paths to other store objects never do, the two maps can also be combined into one. Derivations can also be encoded as store objects too.

  • A build trace, a record of which derivations have been built and what they produced.

    Warning

    The concept of a build trace is currently experimental and subject to change.

There are multiple types of Nix stores with different capabilities, such as the default one on the local file system (/nix/store) or binary caches.