From bd628cf3da14b7d3fe0ba00932eb26d545b4b893 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 22 Nov 2021 13:29:49 +0100 Subject: flakes: fix boolean and int nixConfig values Some type confusion was causing ints to be pointers, and bools to be ints. Fixes #5621 --- src/libexpr/flake/config.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libexpr/flake/config.cc') diff --git a/src/libexpr/flake/config.cc b/src/libexpr/flake/config.cc index c03f4106c..7ecd61816 100644 --- a/src/libexpr/flake/config.cc +++ b/src/libexpr/flake/config.cc @@ -38,11 +38,11 @@ void ConfigFile::apply() // FIXME: Move into libutil/config.cc. std::string valueS; - if (auto s = std::get_if(&value)) + if (auto* s = std::get_if(&value)) valueS = *s; - else if (auto n = std::get_if(&value)) - valueS = fmt("%d", n); - else if (auto b = std::get_if>(&value)) + else if (auto* n = std::get_if(&value)) + valueS = fmt("%d", *n); + else if (auto* b = std::get_if>(&value)) valueS = b->t ? "true" : "false"; else if (auto ss = std::get_if>(&value)) valueS = concatStringsSep(" ", *ss); // FIXME: evil -- cgit v1.2.3