aboutsummaryrefslogtreecommitdiff
path: root/src/nix/show-derivation.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/show-derivation.cc')
-rw-r--r--src/nix/show-derivation.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nix/show-derivation.cc b/src/nix/show-derivation.cc
index a868023d4..f9952e177 100644
--- a/src/nix/show-derivation.cc
+++ b/src/nix/show-derivation.cc
@@ -70,10 +70,15 @@ struct CmdShowDerivation : InstallablesCommand
for (auto & output : drv.outputs) {
auto outputObj(outputsObj.object(output.first));
outputObj.attr("path", store->printStorePath(output.second.path(*store, drv.name)));
- if (auto hash = std::get_if<DerivationOutputFixed>(&output.second.output)) {
- outputObj.attr("hashAlgo", hash->hash.printMethodAlgo());
- outputObj.attr("hash", hash->hash.hash.to_string(Base16, false));
- }
+
+ std::visit(overloaded {
+ [&](DerivationOutputInputAddressed doi) {
+ },
+ [&](DerivationOutputFixed dof) {
+ outputObj.attr("hashAlgo", dof.hash.printMethodAlgo());
+ outputObj.attr("hash", dof.hash.hash.to_string(Base16, false));
+ },
+ }, output.second.output);
}
}