# The Nix store

The _Nix store_ is a storage system in your filesystem with its root at `/nix/store` by default.
The Nix daemon stores several things in the Nix store:

- [Derivations]: stand-alone files suffixed with `.drv` such as `/nix/store/<hash>-my-package.drv`
- The products of [derivations]: a folder containing build outputs such as `/nix/store/<hash>-my-package/`
- [Patches]: stand-alone files suffixed with `.patch` such as `/nix/store/<hash>-my-package.patch`

## Store paths

Paths in the Nix store have this structure:

<NixStorePath pkg="my-package-1.0" />

Let's break store paths down into their constituent elements:

1. The **root path** is `/nix/store` by default.
2. The **input hash** is derived from the inputs to the [derivation][derivations] used to build the package
3. The **package name** is provided by the package creator

Some important things to note about store paths in Nix:

- The root path at `/nix/store` doesn't conflict with other standard system paths like `/usr/bin`.
- The hash ensures that two packages with the same name have completely different paths if the inputs to the package differ _at all_. If you were to change one letter in one file in the inputs to `my-package-1.0`, for example, you may end up with a store path like `/nix/store/1aq3wchnvv7yn0d6y1r3j129hjqmv2k3-my-package-1.0`.
- Package names are fundamentally arbitrary. You can provide whatever naming conventions you wish. If you don't want your packages to have a concept of version, you can name them `my-package` and distinguish based on the input hash.

[derivations]: /concepts/derivations
[patches]: https://nixos.org/manual/nixpkgs/stable/#sec-patches