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

* Allow the size of the GC reserved file to be specified in nix.conf

through the new `gc-reserved-space' option.
This commit is contained in:
Eelco Dolstra 2006-02-16 13:58:10 +00:00
parent 651ab439cf
commit 345a95afe9
5 changed files with 62 additions and 14 deletions

View file

@ -75,17 +75,22 @@ Strings querySetting(const string & name, const Strings & def)
}
bool queryBoolSetting(const string & name, bool def)
string querySetting(const string & name, const string & def)
{
Strings defs;
if (def) defs.push_back("true"); else defs.push_back("false");
defs.push_back(def);
Strings value = querySetting(name, defs);
if (value.size() != 1)
throw Error(format("configuration option `%1%' should be either `true' or `false', not a list")
% name);
string v = value.front();
throw Error(format("configuration option `%1%' should not be a list") % name);
return value.front();
}
bool queryBoolSetting(const string & name, bool def)
{
string v = querySetting(name, def ? "true" : "false");
if (v == "true") return true;
else if (v == "false") return false;
else throw Error(format("configuration option `%1%' should be either `true' or `false', not `%2%'")