aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-17 17:25:17 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-17 17:25:17 +0000
commit2546c63373149dea1511b892a9911768bd770cac (patch)
tree8766f3de7a9cd344e5b9067f83091ae7a28cfd0c /src/libstore/local-store.hh
parent7349f257da8278af9aae35544b15c9a204e2a57b (diff)
parentf66bbd8c7bb1472facf8917e58e3cd4f6ddfa1b5 (diff)
Merge commit 'f66bbd8c7bb1472facf8917e58e3cd4f6ddfa1b5' into auto-uid-allocation
Diffstat (limited to 'src/libstore/local-store.hh')
-rw-r--r--src/libstore/local-store.hh48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index 79b415875..118c7149b 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -23,18 +23,26 @@ namespace nix {
const int nixSchemaVersion = 10;
-struct Derivation;
-
-
struct OptimiseStats
{
unsigned long filesLinked = 0;
- unsigned long long bytesFreed = 0;
- unsigned long long blocksFreed = 0;
+ uint64_t bytesFreed = 0;
+ uint64_t blocksFreed = 0;
+};
+
+struct LocalStoreConfig : virtual LocalFSStoreConfig
+{
+ using LocalFSStoreConfig::LocalFSStoreConfig;
+
+ Setting<bool> requireSigs{(StoreConfig*) this,
+ settings.requireSigs,
+ "require-sigs", "whether store paths should have a trusted signature on import"};
+
+ const std::string name() override { return "Local Store"; }
};
-class LocalStore : public LocalFSStore
+class LocalStore : public LocalFSStore, public virtual LocalStoreConfig
{
private:
@@ -98,10 +106,6 @@ public:
private:
- Setting<bool> requireSigs{(Store*) this,
- settings.requireSigs,
- "require-sigs", "whether store paths should have a trusted signature on import"};
-
const PublicKeys & getPublicKeys();
public:
@@ -133,29 +137,20 @@ public:
StorePathSet queryValidDerivers(const StorePath & path) override;
- OutputPathMap queryDerivationOutputMap(const StorePath & path) override;
+ std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(const StorePath & path) override;
std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override;
StorePathSet querySubstitutablePaths(const StorePathSet & paths) override;
- void querySubstitutablePathInfos(const StorePathSet & paths,
+ void querySubstitutablePathInfos(const StorePathCAMap & paths,
SubstitutablePathInfos & infos) override;
void addToStore(const ValidPathInfo & info, Source & source,
- RepairFlag repair, CheckSigsFlag checkSigs,
- std::shared_ptr<FSAccessor> accessor) override;
-
- StorePath addToStore(const string & name, const Path & srcPath,
- FileIngestionMethod method, HashType hashAlgo,
- PathFilter & filter, RepairFlag repair) override;
+ RepairFlag repair, CheckSigsFlag checkSigs) override;
- /* Like addToStore(), but the contents of the path are contained
- in `dump', which is either a NAR serialisation (if recursive ==
- true) or simply the contents of a regular file (if recursive ==
- false). */
- StorePath addToStoreFromDump(const string & dump, const string & name,
- FileIngestionMethod method = FileIngestionMethod::Recursive, HashType hashAlgo = htSHA256, RepairFlag repair = NoRepair) override;
+ StorePath addToStoreFromDump(Source & dump, const string & name,
+ FileIngestionMethod method, HashType hashAlgo, RepairFlag repair) override;
StorePath addTextToStore(const string & name, const string & s,
const StorePathSet & references, RepairFlag repair) override;
@@ -291,6 +286,11 @@ private:
specified by the ‘secret-key-files’ option. */
void signPathInfo(ValidPathInfo & info);
+ /* Register the store path 'output' as the output named 'outputName' of
+ derivation 'deriver'. */
+ void linkDeriverToPath(const StorePath & deriver, const string & outputName, const StorePath & output);
+ void linkDeriverToPath(State & state, uint64_t deriver, const string & outputName, const StorePath & output);
+
Path getRealStoreDir() override { return realStoreDir; }
void createUser(const std::string & userName, uid_t userId) override;