diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-12-17 17:17:53 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-12-17 17:17:53 +0100 |
commit | f8abbdd4565542464f31f4dc203a9c3e091b3536 (patch) | |
tree | 5a582db41f23602b441a7fcb5ede5339fc1b6d42 /src/libstore/store-api.hh | |
parent | 54bf5ba4227a234f8cd5102634b9a3b535e6fbdb (diff) |
Add priority setting to stores
This allows overriding the priority of substituters, e.g.
$ nix-store --store ~/my-nix/ -r /nix/store/df3m4da96d84ljzxx4mygfshm1p0r2n3-geeqie-1.4 \
--substituters 'http://cache.nixos.org?priority=100 daemon?priority=10'
Fixes #3264.
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r-- | src/libstore/store-api.hh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index d77d6bad8..743be9410 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -255,6 +255,10 @@ public: const Setting<bool> isTrusted{this, false, "trusted", "whether paths from this store can be used as substitutes even when they lack trusted signatures"}; + Setting<int> priority{this, 0, "priority", "priority of this substituter (lower value means higher priority)"}; + + Setting<bool> wantMassQuery{this, false, "want-mass-query", "whether this substituter can be queried efficiently for path validity"}; + protected: struct State @@ -422,8 +426,6 @@ public: virtual void querySubstitutablePathInfos(const StorePathSet & paths, SubstitutablePathInfos & infos) { return; }; - virtual bool wantMassQuery() { return false; } - /* Import a path into the store. */ virtual void addToStore(const ValidPathInfo & info, Source & narSource, RepairFlag repair = NoRepair, CheckSigsFlag checkSigs = CheckSigs, @@ -648,11 +650,6 @@ public: return 0; }; - /* Get the priority of the store, used to order substituters. In - particular, binary caches can specify a priority field in their - "nix-cache-info" file. Lower value means higher priority. */ - virtual int getPriority() { return 0; } - virtual Path toRealPath(const Path & storePath) { return storePath; |