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

flakes: fix boolean and int nixConfig values

Some type confusion was causing ints to be pointers, and bools
to be ints. Fixes #5621
This commit is contained in:
Yorick van Pelt 2021-11-22 13:29:49 +01:00
parent 9cd8cffefc
commit bd628cf3da
No known key found for this signature in database
GPG key ID: D8D3CC6D951384DE
2 changed files with 5 additions and 5 deletions

View file

@ -38,11 +38,11 @@ void ConfigFile::apply()
// FIXME: Move into libutil/config.cc.
std::string valueS;
if (auto s = std::get_if<std::string>(&value))
if (auto* s = std::get_if<std::string>(&value))
valueS = *s;
else if (auto n = std::get_if<int64_t>(&value))
valueS = fmt("%d", n);
else if (auto b = std::get_if<Explicit<bool>>(&value))
else if (auto* n = std::get_if<int64_t>(&value))
valueS = fmt("%d", *n);
else if (auto* b = std::get_if<Explicit<bool>>(&value))
valueS = b->t ? "true" : "false";
else if (auto ss = std::get_if<std::vector<std::string>>(&value))
valueS = concatStringsSep(" ", *ss); // FIXME: evil