Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::LocalOverlayStoreConfig Struct Reference

#include <local-overlay-store.hh>

Inheritance diagram for nix::LocalOverlayStoreConfig:
nix::LocalStoreConfig nix::LocalFSStoreConfig nix::LocalBuildStoreConfig nix::StoreConfig nix::LocalFSStoreConfig nix::StoreConfigBase nix::StoreDirConfig nix::StoreConfig nix::Config nix::StoreConfigBase nix::StoreDirConfig nix::AbstractConfig nix::Config nix::AbstractConfig

Public Member Functions

 LocalOverlayStoreConfig (const StringMap &params)
 LocalOverlayStoreConfig (const std::filesystem::path &path, const Params &params)
ref< Store > openStore () const override
StoreReference getReference () const override
Public Member Functions inherited from nix::LocalStoreConfig
 LocalStoreConfig (const Params &params)
 LocalStoreConfig (const std::filesystem::path &path, const Params &params)
bool getReadOnly () const override
std::filesystem::path getRootsSocketPath () const
ref< Store > openStore () const override
StoreReference getReference () const override
Public Member Functions inherited from nix::LocalFSStoreConfig
 LocalFSStoreConfig (const Params &params)
 LocalFSStoreConfig (const std::filesystem::path &path, const Params &params)
const std::filesystem::path & getStateDir () const override
const std::filesystem::path & getLogDir () const override
Public Member Functions inherited from nix::StoreConfig
 StoreConfig (const Params &params, FilePathType pathType)
StringMap getQueryParams () const
virtual std::string getHumanReadableURI () const
Public Member Functions inherited from nix::StoreConfigBase
 StoreConfigBase (const StoreReference::Params &params, FilePathType pathType)
Public Member Functions inherited from nix::Config
 Config (StringMap initials={})
bool set (const std::string &name, const std::string &value) override
void addSetting (AbstractSetting *setting)
void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false) const override
void resetOverridden () override
nlohmann::json toJSON () override
std::string toKeyValue (bool overriddenOnly=false) override
void convertToArgs (Args &args, const std::string &category) override
Public Member Functions inherited from nix::AbstractConfig
void applyConfig (const std::string &contents, const std::string &path="<unknown>")
void warnUnknownSettings ()
void reapplyUnknownSettings ()
Public Member Functions inherited from nix::StoreDirConfig
StorePath parseStorePath (std::string_view path) const
StorePath parseStorePathCanonical (std::string_view path) const
std::optional< StorePath > maybeParseStorePath (std::string_view path) const
std::string printStorePath (const StorePath &path) const
StringSet printStorePathSet (const StorePathSet &path) const
std::size_t maxCanonicalStorePathLen () const noexcept
bool isInStore (std::string_view path) const
bool isStorePath (std::string_view path) const
std::pair< StorePath, CanonPath > toStorePath (std::string_view path) const
StorePath makeStorePath (std::string_view type, std::string_view hash, std::string_view name) const
StorePath makeStorePath (std::string_view type, const Hash &hash, std::string_view name) const
StorePath makeOutputPath (std::string_view id, const Hash &hash, std::string_view name) const
StorePath makeFixedOutputPath (std::string_view name, const FixedOutputInfo &info) const
StorePath makeFixedOutputPathFromCA (std::string_view name, const ContentAddressWithReferences &ca) const
std::pair< StorePath, Hash > computeStorePath (std::string_view name, const SourcePath &path, ContentAddressMethod method=ContentAddressMethod::Raw::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references={}, PathFilter &filter=defaultPathFilter) const
Public Member Functions inherited from nix::LocalBuildStoreConfig
const LocalSettings & getLocalSettings () const
std::filesystem::path getBuildDir () const

Static Public Member Functions

static const std::string name ()
static std::optional< ExperimentalFeature > experimentalFeature ()
static StringSet uriSchemes ()
static std::string doc ()
Static Public Member Functions inherited from nix::LocalStoreConfig
static const std::string name ()
static StringSet uriSchemes ()
static std::string doc ()
Static Public Member Functions inherited from nix::StoreConfig
static StringSet getDefaultSystemFeatures ()
static std::string doc ()
static std::optional< ExperimentalFeature > experimentalFeature ()

Public Attributes

Setting< std::string > lowerStoreUri
const Setting< AbsolutePath > upperLayer
Setting< bool > checkMount
const Setting< std::optional< AbsolutePath > > remountHook
Public Attributes inherited from nix::LocalStoreConfig
Setting< bool > requireSigs
Setting< bool > readOnly
Setting< bool > ignoreGcDeleteFailure
Setting< bool > useRootsDaemon
Public Attributes inherited from nix::LocalFSStoreConfig
Setting< std::optional< AbsolutePath > > rootDir = makeRootDirSetting(*this, std::nullopt)
Setting< AbsolutePath > stateDir
Setting< AbsolutePath > logDir
Setting< AbsolutePath > realStoreDir
Public Attributes inherited from nix::StoreConfig
Setting< int > pathInfoCacheSize
Setting< bool > isTrusted
Setting< int > priority
Setting< bool > wantMassQuery
Setting< StringSet > systemFeatures
Public Attributes inherited from nix::StoreConfigBase
StoreDirSetting storeDir_
Public Attributes inherited from nix::StoreDirConfig
const std::string & storeDir

Protected Member Functions

std::filesystem::path toUpperPath (const StorePath &path) const
Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})

Friends

struct LocalOverlayStore

Additional Inherited Members

Public Types inherited from nix::StoreConfig
using Params = StoreReference::Params
Public Types inherited from nix::Config
using Settings = std::map<std::string, SettingData>
Protected Types inherited from nix::StoreConfigBase
enum struct  FilePathType { Unix , Native }
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Detailed Description

Configuration for LocalOverlayStore.

Member Function Documentation

◆ getReference()

StoreReference nix::LocalOverlayStoreConfig::getReference ( ) const
overridevirtual

Render the config back to a StoreReference. It should round-trip with resolveStoreConfig (for stores configs that are registered).

Reimplemented from nix::StoreConfig.

◆ openStore()

ref< Store > nix::LocalOverlayStoreConfig::openStore ( ) const
overridevirtual

Open a store of the type corresponding to this configuration type.

Implements nix::StoreConfig.

◆ toUpperPath()

std::filesystem::path nix::LocalOverlayStoreConfig::toUpperPath ( const StorePath & path) const
protected
Returns
The host OS path corresponding to the store path for the upper layer.
Note
The there is no guarantee a store object is actually stored at that file path. It might be stored in the lower layer instead, or it might not be part of this store at all.

Member Data Documentation

◆ checkMount

Setting<bool> nix::LocalOverlayStoreConfig::checkMount
Initial value:
{
(StoreConfig *) this,
true,
"check-mount",
R"(
Check that the overlay filesystem is correctly mounted.
Nix does not manage the overlayfs mount point itself, but the correct
functioning of the overlay store does depend on this mount point being set up
correctly. Rather than just assume this is the case, check that the lowerdir
and upperdir options are what we expect them to be. This check is on by
default, but can be disabled if needed.
)"}
Definition store-api.hh:240

◆ lowerStoreUri

Setting<std::string> nix::LocalOverlayStoreConfig::lowerStoreUri
Initial value:
{
(StoreConfig *) this,
"",
"lower-store",
R"(
[Store URL](@docroot@/command-ref/new-cli/nix3-help-stores.md#store-url-format)
for the lower store. The default is `auto` (i.e. use the Nix daemon or `/nix/store` directly).
Must be a store with a store dir on the file system.
Must be used as OverlayFS lower layer for this store's store dir.
)"}

◆ remountHook

const Setting<std::optional<AbsolutePath> > nix::LocalOverlayStoreConfig::remountHook
Initial value:
{
(StoreConfig *) this,
std::nullopt,
"remount-hook",
R"(
Script or other executable to run when overlay filesystem needs remounting.
This is occasionally necessary when deleting a store path that exists in both upper and lower layers.
In such a situation, bypassing OverlayFS and deleting the path in the upper layer directly
is the only way to perform the deletion without creating a "whiteout".
However this causes the OverlayFS kernel data structures to get out-of-sync,
and can lead to 'stale file handle' errors; remounting solves the problem.
The store directory is passed as an argument to the invoked executable.
)"}

◆ upperLayer

const Setting<AbsolutePath> nix::LocalOverlayStoreConfig::upperLayer
Initial value:
{
(StoreConfig *) this,
"/"
"upper-layer-must-be-set",
"upper-layer",
R"(
Directory containing the OverlayFS upper layer for this store's store dir.
)"}

The documentation for this struct was generated from the following files: