1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 15:51:15 +02:00

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.
This commit is contained in:
Eelco Dolstra 2019-12-17 17:17:53 +01:00
parent 54bf5ba422
commit f8abbdd456
13 changed files with 51 additions and 47 deletions

View file

@ -49,9 +49,9 @@ void BinaryCacheStore::init()
throw Error(format("binary cache '%s' is for Nix stores with prefix '%s', not '%s'")
% getUri() % value % storeDir);
} else if (name == "WantMassQuery") {
wantMassQuery_ = value == "1";
wantMassQuery.setDefault(value == "1" ? "true" : "false");
} else if (name == "Priority") {
string2Int(value, priority);
priority.setDefault(fmt("%d", std::stoi(value)));
}
}
}