Home Explore Blog CI



nix

2nd chunk of `src/libstore/local-overlay-store.md`
24684167b39ebaedbe1f5c3d955da39b135a862eff14e59500000001000008d5
    Linux's OverlayFS in addition imposes the further requirement that this directory cannot change at all.
    That means that, while any local overlay store exists that is using this store as a lower store, this directory must not change.

  - **Lower metadata source**:

    > Not directly specified.
    > A consequence of the `lower-store` setting, depending on the type of lower store chosen.

    This is abstract, just some way to read the metadata of lower store [store objects][store object].
    For example it could be a SQLite database (for the [local store]), or a socket connection (for the [local daemon store]).

    This need not be writable.
    As stated above a local overlay store never tries to modify its lower store.
    The lower store's metadata is considered part of the lower store, just as the store's [file system objects][file system object] that appear in the store directory are.

- **Upper almost-store**:

  > Not directly specified.
  > Instead the constituent parts are independently specified as described below.

  This is almost but not quite just a [local store].
  That is because taken in isolation, not as part of a local overlay store, by itself, it would appear corrupted.
  But combined with everything else as part of an overlay local store, it is valid.

  - **Upper layer directory**:

    > Specified with [`upper-layer`](#store-experimental-local-overlay-store-upper-layer) setting.

    This contains additional [store objects][store object]
    (or, strictly speaking, their [file system objects][file system object] that the local overlay store will extend the lower store with).

  - **Upper store directory**:

    > Specified with the [`real`](#store-experimental-local-overlay-store-real) setting.
    > This the same as the base local store setting, and can also be indirectly specified with the [`root`](#store-experimental-local-overlay-store-root) setting.

    This contains all the store objects from each of the two directories.

    The lower store directory and upper layer directory are combined via OverlayFS to create this directory.
    Nix doesn't do this itself, because it typically wouldn't have the permissions to do so, so it is the responsibility of the user to set this up first.

Title: Local Overlay Store: Upper Almost-Store and Directory Structure
Summary
The lower store directory used in a local overlay store setup must remain unchanged while in use. The lower store's metadata source (e.g., SQLite database or socket connection) is read-only. The upper almost-store, not a valid local store on its own, consists of an upper layer directory containing additional store objects and an upper store directory which combines the lower and upper layers via OverlayFS. The creation of the upper store directory is the user's responsibility.