Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::LocalFSStoreConfig Struct Reference
Inheritance diagram for nix::LocalFSStoreConfig:
nix::StoreConfig nix::StoreConfigBase nix::StoreDirConfig nix::Config nix::AbstractConfig nix::LocalBuildStoreConfig nix::LocalStoreConfig nix::MountedSSHStoreConfig nix::UDSRemoteStoreConfig nix::LocalStoreConfig nix::LocalOverlayStoreConfig nix::LocalOverlayStoreConfig

Public Member Functions

 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 bool getReadOnly () const
virtual ref< Store > openStore () const =0
virtual StoreReference getReference () 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 Attributes

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

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>
Static Public Member Functions inherited from nix::StoreConfig
static StringSet getDefaultSystemFeatures ()
static std::string doc ()
static std::optional< ExperimentalFeature > experimentalFeature ()
Protected Types inherited from nix::StoreConfigBase
enum struct  FilePathType { Unix , Native }
Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Constructor & Destructor Documentation

◆ LocalFSStoreConfig()

nix::LocalFSStoreConfig::LocalFSStoreConfig ( const std::filesystem::path & path,
const Params & params )

Used to override the root settings. Can't be done via modifying params reliably because this parameter is unused except for passing to base class constructors.

Todo
Make this less error-prone with new store settings system.

Member Function Documentation

◆ getLogDir()

const std::filesystem::path & nix::LocalFSStoreConfig::getLogDir ( ) const
inlineoverridevirtual
Returns
The log directory for this store.

By default, returns the global log directory. Subclasses like LocalFSStoreConfig may override to return a store-specific log directory.

Reimplemented from nix::StoreConfig.

◆ getStateDir()

const std::filesystem::path & nix::LocalFSStoreConfig::getStateDir ( ) const
inlineoverridevirtual
Returns
The state directory for this store.

By default, returns the global settings.nixStateDir. Subclasses like LocalFSStoreConfig may override to return a store-specific state directory.

Reimplemented from nix::StoreConfig.

Member Data Documentation

◆ logDir

Setting<AbsolutePath> nix::LocalFSStoreConfig::logDir
Initial value:
{
this,
rootDir.get() ? *rootDir.get() / "nix" / "var" / "log" / "nix" : StoreConfig::getLogDir(),
"log",
R"(
Directory where Nix stores log files.
Defaults to [`NIX_LOG_DIR`](@docroot@/command-ref/env-common.md#env-NIX_LOG_DIR) when [`root`](#@store-slug@-root) is not set.
)",
}
virtual const std::filesystem::path & getLogDir() const
Definition store-api.cc:1301

◆ realStoreDir

Setting<AbsolutePath> nix::LocalFSStoreConfig::realStoreDir
Initial value:
{
this,
rootDir.get() ? *rootDir.get() / "nix" / "store" : std::filesystem::path{storeDir},
"real",
R"(
Physical path of the Nix store.
Defaults to [`store`](#@store-slug@-store) when [`root`](#@store-slug@-root) is not set.
)",
}

◆ stateDir

Setting<AbsolutePath> nix::LocalFSStoreConfig::stateDir
Initial value:
{
this,
rootDir.get() ? *rootDir.get() / "nix" / "var" / "nix" : StoreConfig::getStateDir(),
"state",
R"(
Directory where Nix stores state.
Defaults to [`NIX_STATE_DIR`](@docroot@/command-ref/env-common.md#env-NIX_STATE_DIR) when [`root`](#@store-slug@-root) is not set.
)",
}
virtual const std::filesystem::path & getStateDir() const
Definition store-api.cc:1296

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