From b4c2191838d071780381b53041a38b2b86612f5e Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 3 Aug 2022 20:17:37 +0200 Subject: [PATCH] New `nix profile list` UI Also includes a compatibility hack for Home Manager --- src/nix/profile.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/nix/profile.cc b/src/nix/profile.cc index cc33f3ab3..02f6b12c2 100644 --- a/src/nix/profile.cc +++ b/src/nix/profile.cc @@ -542,9 +542,13 @@ struct CmdProfileList : virtual EvalCommand, virtual StoreCommand, MixDefaultPro for (size_t i = 0; i < manifest.elements.size(); ++i) { auto & element(manifest.elements[i]); - logger->cout("%03d %s\t%s", i, - element.source ? element.source->originalRef.to_string() + "#" + element.source->attrPath + printOutputsSpec(element.source->outputs) : "-", - concatStringsSep(" ", store->printStorePathSet(element.storePaths))); + if (element.source) { + logger->cout("%03d:\n\tInstallable: %s\n\tStore paths: %s", i, + element.source ? element.source->originalRef.to_string() + "#" + element.source->attrPath + printOutputsSpec(element.source->outputs) : "-", + concatStringsSep(" ", store->printStorePathSet(element.storePaths))); + } else { + logger->cout("%03d - - %s", i, concatStringsSep(" ", store->printStorePathSet(element.storePaths))); + } } } };