aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/flake/flake.hh2
-rw-r--r--src/nix/flake.cc6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libexpr/flake/flake.hh b/src/libexpr/flake/flake.hh
index d44113506..afd49436b 100644
--- a/src/libexpr/flake/flake.hh
+++ b/src/libexpr/flake/flake.hh
@@ -33,7 +33,7 @@ struct Flake
{
FlakeRef originalRef;
FlakeRef resolvedRef;
- std::string description;
+ std::optional<std::string> description;
std::shared_ptr<const fetchers::Tree> sourceInfo;
std::map<FlakeId, FlakeInput> inputs;
Value * vOutputs; // FIXME: gc
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 5bec5903f..bfff682d9 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -80,7 +80,8 @@ static void printFlakeInfo(const Store & store, const Flake & flake)
{
std::cout << fmt("URL: %s\n", flake.resolvedRef.input->to_string());
std::cout << fmt("Edition: %s\n", flake.edition);
- std::cout << fmt("Description: %s\n", flake.description);
+ if (flake.description)
+ std::cout << fmt("Description: %s\n", *flake.description);
std::cout << fmt("Path: %s\n", store.printStorePath(flake.sourceInfo->storePath));
if (flake.sourceInfo->rev)
std::cout << fmt("Revision: %s\n", flake.sourceInfo->rev->to_string(Base16, false));
@@ -94,7 +95,8 @@ static void printFlakeInfo(const Store & store, const Flake & flake)
static nlohmann::json flakeToJson(const Store & store, const Flake & flake)
{
nlohmann::json j;
- j["description"] = flake.description;
+ if (flake.description)
+ j["description"] = *flake.description;
j["edition"] = flake.edition;
j["url"] = flake.resolvedRef.input->to_string();
if (flake.sourceInfo->rev)