#include "path.hh"
#include "derived-path.hh"
#include "hash.hh"
#include "content-address.hh"
#include "serialise.hh"
#include "lru-cache.hh"
#include "sync.hh"
#include "globals.hh"
#include "config.hh"
#include "path-info.hh"
#include "repair-flag.hh"
#include "store-dir-config.hh"
#include "store-reference.hh"
#include "source-path.hh"
#include <nlohmann/json_fwd.hpp>
#include <atomic>
#include <map>
#include <memory>
#include <string>
#include <chrono>
Go to the source code of this file.
Classes | |
struct | nix::StoreConfig |
class | nix::Store |
struct | nix::Store::PathInfoCacheValue |
struct | nix::Store::State |
struct | nix::Store::Stats |
struct | nix::StoreFactory |
struct | nix::Implementations |
struct | nix::RegisterStoreImplementation< T, TConfig > |
Typedefs | |
typedef std::map< std::string, StorePath > | nix::OutputPathMap |
typedef std::map< StorePath, std::optional< ContentAddress > > | nix::StorePathCAMap |
Functions | |
nix::MakeError (SubstError, Error) | |
nix::MakeError (BuildError, Error) | |
nix::MakeError (InvalidPath, Error) | |
nix::MakeError (Unsupported, Error) | |
nix::MakeError (SubstituteGone, Error) | |
nix::MakeError (SubstituterDisabled, Error) | |
nix::MakeError (InvalidStoreReference, Error) | |
void | nix::copyStorePath (Store &srcStore, Store &dstStore, const StorePath &storePath, RepairFlag repair, CheckSigsFlag checkSigs) |
std::map< StorePath, StorePath > | nix::copyPaths (Store &srcStore, Store &dstStore, const std::set< RealisedPath > &, RepairFlag repair=NoRepair, CheckSigsFlag checkSigs=CheckSigs, SubstituteFlag substitute=NoSubstitute) |
std::map< StorePath, StorePath > | nix::copyPaths (Store &srcStore, Store &dstStore, const StorePathSet &storePaths, RepairFlag repair, CheckSigsFlag checkSigs, SubstituteFlag substitute) |
void | nix::copyClosure (Store &srcStore, Store &dstStore, const std::set< RealisedPath > &paths, RepairFlag repair=NoRepair, CheckSigsFlag checkSigs=CheckSigs, SubstituteFlag substitute=NoSubstitute) |
void | nix::copyClosure (Store &srcStore, Store &dstStore, const StorePathSet &storePaths, RepairFlag repair, CheckSigsFlag checkSigs, SubstituteFlag substitute) |
void | nix::removeTempRoots () |
StorePath | nix::resolveDerivedPath (Store &store, const SingleDerivedPath &req, Store *evalStore_) |
OutputPathMap | nix::resolveDerivedPath (Store &store, const DerivedPath::Built &bfd, Store *evalStore_) |
ref< Store > | nix::openStore (StoreReference &&storeURI) |
ref< Store > | nix::openStore (const std::string &uri, const Store::Params &extraParams) |
std::list< ref< Store > > | nix::getDefaultSubstituters () |
std::string | nix::showPaths (const PathSet &paths) |
std::optional< ValidPathInfo > | nix::decodeValidPathInfo (const Store &store, std::istream &str, std::optional< HashResult > hashGiven) |
const ContentAddress * | nix::getDerivationCA (const BasicDerivation &drv) |
std::map< DrvOutput, StorePath > | nix::drvOutputReferences (Store &store, const Derivation &drv, const StorePath &outputPath, Store *evalStore_) |
Variables | |
const uint32_t | nix::exportMagic = 0x4558494e |
void nix::copyClosure | ( | Store & | srcStore, |
Store & | dstStore, | ||
const std::set< RealisedPath > & | paths, | ||
RepairFlag | repair = NoRepair, | ||
CheckSigsFlag | checkSigs = CheckSigs, | ||
SubstituteFlag | substitute = NoSubstitute ) |
Copy the closure of paths
from srcStore
to dstStore
.
std::map< StorePath, StorePath > nix::copyPaths | ( | Store & | srcStore, |
Store & | dstStore, | ||
const std::set< RealisedPath > & | , | ||
RepairFlag | repair = NoRepair, | ||
CheckSigsFlag | checkSigs = CheckSigs, | ||
SubstituteFlag | substitute = NoSubstitute ) |
Copy store paths from one store to another. The paths may be copied in parallel. They are copied in a topologically sorted order (i.e. if A is a reference of B, then A is copied before B), but the set of store paths is not automatically closed; use copyClosure() for that.
void nix::copyStorePath | ( | Store & | srcStore, |
Store & | dstStore, | ||
const StorePath & | storePath, | ||
RepairFlag | repair = NoRepair, | ||
CheckSigsFlag | checkSigs = CheckSigs ) |
Copy a path from one store to another.
std::list< ref< Store > > nix::getDefaultSubstituters | ( | ) |
nix::MakeError | ( | BuildError | , |
Error | ) |
denotes a permanent build failure
nix::MakeError | ( | SubstError | , |
Error | ) |
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 const Setting<T>
(or subclasses of it) and inherit the constructors of StoreConfig
(using StoreConfig::StoreConfig
).
A class Foo : virtual Store, virtual FooConfig
that contains the implementation of the store.
This class is expected to have a constructor Foo(const Params & params)
that calls StoreConfig(params)
(otherwise you're gonna encounter an assertion failure
when trying to instantiate it).
You can then register the new store using:
ref< Store > nix::openStore | ( | const std::string & | uri = settings.storeUri.get(), |
const Store::Params & | extraParams = Store::Params() ) |
Opens the store at uri
, where uri
is in the format expected by StoreReference::parse
ref< Store > nix::openStore | ( | StoreReference && | storeURI | ) |
void nix::removeTempRoots | ( | ) |
Remove the temporary roots file for this process. Any temporary root becomes garbage after this point unless it has been registered as a (permanent) root.
StorePath nix::resolveDerivedPath | ( | Store & | , |
const SingleDerivedPath & | , | ||
Store * | evalStore = nullptr ) |
Resolve the derived path completely, failing if any derivation output is unknown.
std::string nix::showPaths | ( | const PathSet & | paths | ) |
Display a set of paths in human-readable form (i.e., between quotes and separated by commas).
const uint32_t nix::exportMagic = 0x4558494e |
Magic header of exportPath() output (obsolete).