![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <store-api.hh>
Public Types | |
| using | Params = StoreReference::Params |
| Public Types inherited from nix::Config | |
| using | Settings = std::map<std::string, SettingData> |
Public Member Functions | |
| StoreConfig (const Params ¶ms, FilePathType pathType) | |
| StringMap | getQueryParams () const |
| virtual bool | getReadOnly () const |
| virtual const std::filesystem::path & | getStateDir () const |
| virtual const std::filesystem::path & | getLogDir () 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 ¶ms, 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 |
Static Public Member Functions | |
| static StringSet | getDefaultSystemFeatures () |
| static std::string | doc () |
| static std::optional< ExperimentalFeature > | experimentalFeature () |
Public Attributes | |
| 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 | |
| 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 |
About the class hierarchy of the store types:
Each store type Foo consists of two classes:
A class FooConfig : virtual StoreConfig that contains the configuration for the store
It should only contain members of type Setting<T> (or subclasses of it) and inherit the constructors of StoreConfig (using StoreConfig::StoreConfig).
A class Foo : virtual Store that contains the implementation of the store.
This class is expected to have:
You can then register the new store using:
|
inlinestatic |
Documentation for this type of store.
|
inlinestatic |
An experimental feature this type store is gated, if it is to be experimental.
|
inlinevirtual |
Get a textual representation of the store reference.
Can be implemented by subclasses to make the URI more legible, e.g. when some query parameters are necessary to make sense of the URI.
Reimplemented in nix::S3BinaryCacheStoreConfig.
|
virtual |
By default, returns the global log directory. Subclasses like LocalFSStoreConfig may override to return a store-specific log directory.
Reimplemented in nix::LocalFSStoreConfig.
|
inline |
Get overridden store reference query parameters.
|
virtual |
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 in nix::DummyStoreConfig, and nix::LocalStoreConfig.
|
virtual |
Render the config back to a StoreReference. It should round-trip with resolveStoreConfig (for stores configs that are registered).
Reimplemented in nix::DummyStoreConfig, nix::HttpBinaryCacheStoreConfig, nix::LegacySSHStoreConfig, nix::LocalBinaryCacheStoreConfig, nix::LocalOverlayStoreConfig, nix::LocalStoreConfig, nix::SSHStoreConfig, and nix::UDSRemoteStoreConfig.
|
virtual |
By default, returns the global settings.nixStateDir. Subclasses like LocalFSStoreConfig may override to return a store-specific state directory.
Reimplemented in nix::LocalFSStoreConfig.
Open a store of the type corresponding to this configuration type.
Implemented in nix::DummyStoreConfig, nix::HttpBinaryCacheStoreConfig, nix::LegacySSHStoreConfig, nix::LocalBinaryCacheStoreConfig, nix::LocalOverlayStoreConfig, nix::LocalStoreConfig, nix::MountedSSHStoreConfig, nix::S3BinaryCacheStoreConfig, nix::SSHStoreConfig, and nix::UDSRemoteStoreConfig.
| Setting<bool> nix::StoreConfig::isTrusted |
| Setting<int> nix::StoreConfig::pathInfoCacheSize |
| Setting<int> nix::StoreConfig::priority |
| Setting<bool> nix::StoreConfig::wantMassQuery |