Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::StoreDirConfig Struct Reference
Inheritance diagram for nix::StoreDirConfig:
nix::Config nix::AbstractConfig nix::StoreConfig nix::BinaryCacheStoreConfig nix::CommonSSHStoreConfig nix::DummyStoreConfig nix::LocalFSStoreConfig nix::RemoteStoreConfig nix::Store nix::BinaryCacheStore nix::HttpBinaryCacheStoreConfig nix::LocalBinaryCacheStoreConfig nix::S3BinaryCacheStoreConfig nix::LegacySSHStoreConfig nix::SSHStoreConfig nix::DummyStore nix::LocalFSStore nix::LocalStoreConfig nix::MountedSSHStoreConfig nix::UDSRemoteStoreConfig nix::RemoteStore nix::SSHStoreConfig nix::UDSRemoteStoreConfig nix::BinaryCacheStore nix::DummyStore nix::GcStore nix::LegacySSHStore nix::LocalFSStore nix::LogStore nix::RemoteStore

Public Member Functions

StorePath parseStorePath (std::string_view path) const
 
std::optional< StorePathmaybeParseStorePath (std::string_view path) const
 
std::string printStorePath (const StorePath &path) const
 
StorePathSet parseStorePathSet (const PathSet &paths) const
 
PathSet printStorePathSet (const StorePathSet &path) const
 
std::string showPaths (const StorePathSet &paths)
 
bool isInStore (PathView path) const
 
bool isStorePath (std::string_view path) const
 
std::pair< StorePath, PathtoStorePath (PathView 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, HashcomputeStorePath (std::string_view name, const SourcePath &path, ContentAddressMethod method=FileIngestionMethod::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references={}, PathFilter &filter=defaultPathFilter) const
 
 Config (StringMap initials={})
 
- 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) override
 
void resetOverridden () override
 
nlohmann::json toJSON () override
 
std::string toKeyValue () 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 Attributes

const PathSetting storeDir_
 
const Path storeDir = storeDir_
 

Additional Inherited Members

- Public Types inherited from nix::Config
using Settings = std::map<std::string, SettingData>
 
- Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
 
- Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings
 

Member Function Documentation

◆ computeStorePath()

std::pair< StorePath, Hash > nix::StoreDirConfig::computeStorePath ( std::string_view name,
const SourcePath & path,
ContentAddressMethod method = FileIngestionMethod::NixArchive,
HashAlgorithm hashAlgo = HashAlgorithm::SHA256,
const StorePathSet & references = {},
PathFilter & filter = defaultPathFilter ) const

Read-only variant of addToStore(). It returns the store path for the given file sytem object.

◆ isInStore()

bool nix::StoreDirConfig::isInStore ( PathView path) const
Returns
true if path is in the Nix store (but not the Nix store itself).

◆ isStorePath()

bool nix::StoreDirConfig::isStorePath ( std::string_view path) const
Returns
true if path is a store path, i.e. a direct child of the Nix store.

◆ makeStorePath()

StorePath nix::StoreDirConfig::makeStorePath ( std::string_view type,
std::string_view hash,
std::string_view name ) const

Constructs a unique store path name.

◆ parseStorePathSet()

StorePathSet nix::StoreDirConfig::parseStorePathSet ( const PathSet & paths) const

Deprecated

Todo
remove

◆ showPaths()

std::string nix::StoreDirConfig::showPaths ( const StorePathSet & paths)

Display a set of paths in human-readable form (i.e., between quotes and separated by commas).

◆ toStorePath()

std::pair< StorePath, Path > nix::StoreDirConfig::toStorePath ( PathView path) const

Split a path like /nix/store/<hash>-<name>/<bla> into /nix/store/<hash>-<name> and /<bla>.

Member Data Documentation

◆ storeDir_

const PathSetting nix::StoreDirConfig::storeDir_
Initial value:
{this, settings.nixStore,
"store",
R"(
Logical location of the Nix store, usually
`/nix/store`. Note that you can only copy store paths
between stores if they have the same `store` setting.
)"}

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