Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::LocalStoreConfig Struct Reference
Inheritance diagram for 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 nix::LocalOverlayStoreConfig

Public Member Functions

 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 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< 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

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 Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Member Function Documentation

◆ getReadOnly()

bool nix::LocalStoreConfig::getReadOnly ( ) const
overridevirtual

Whether we're allowed to write to this store, also takes into account global readOnly's mode setting, not just any per-store settings.

Reimplemented from nix::StoreConfig.

◆ getReference()

StoreReference nix::LocalStoreConfig::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::LocalStore::Config::openStore ( ) const
overridevirtual

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

Implements nix::StoreConfig.

Member Data Documentation

◆ ignoreGcDeleteFailure

Setting<bool> nix::LocalStoreConfig::ignoreGcDeleteFailure
Initial value:
{
this,
false,
"ignore-gc-delete-failure",
R"(
Whether to ignore failures when deleting items with the garbage collector.
Normally the garbage collector will fail with an error if the nix daemon cannot delete a file, with this setting such errors will only be printed as warnings.
)",
{},
true,
Xp::LocalOverlayStore,
}

◆ readOnly

Setting<bool> nix::LocalStoreConfig::readOnly
Initial value:
{
this,
false,
"read-only",
R"(
Allow this store to be opened when its [database](@docroot@/glossary.md#gloss-nix-database) is on a read-only filesystem.
Normally Nix attempts to open the store database in read-write mode, even for querying (when write access is not needed), causing it to fail if the database is on a read-only filesystem.
Enable read-only mode to disable locking and open the SQLite database with the [`immutable` parameter](https://www.sqlite.org/c3ref/open.html) set.
> **Warning**
> Do not use this unless the filesystem is read-only.
>
> Using it when the filesystem is writable can cause incorrect query results or corruption errors if the database is changed by another process.
> While the filesystem the database resides on might appear to be read-only, consider whether another user or system might have write access to it.
)"}

◆ requireSigs

Setting<bool> nix::LocalStoreConfig::requireSigs
Initial value:
{
this,
getDefaultRequireSigs(),
"require-sigs",
"Whether store paths copied into this store should have a trusted signature."}

◆ useRootsDaemon

Setting<bool> nix::LocalStoreConfig::useRootsDaemon
Initial value:
{
this,
false,
"use-roots-daemon",
R"(
Whether to request garbage collector roots from an external daemon.
When enabled, the garbage collector connects to a Unix domain socket
at [`<state-dir>`](@docroot@/store/types/local-store.md#store-local-store-state)`/gc-roots-socket/socket` to discover additional roots
that should not be collected. This is useful when the Nix daemon runs
without root privileges and cannot scan `/proc` for runtime roots.
The daemon can be started with [`nix store roots-daemon`](@docroot@/command-ref/new-cli/nix3-store-roots-daemon.md).
)",
{},
true,
Xp::LocalOverlayStore,
}

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