aboutsummaryrefslogtreecommitdiff
path: root/src/nix/profile.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-05-04 10:33:58 +0200
committerFelix Uhl <felix.uhl@outlook.com>2023-07-02 16:17:09 +0200
commit87b82db8812736922de851a27681dd0b2955c2f0 (patch)
tree5951f04f252e64f7b4d7a641013b54b3ccb1674a /src/nix/profile.cc
parent7b39a388b382e7912de3c5951faad42fe2d72f48 (diff)
nix profile list: Improve readability of the output
Diffstat (limited to 'src/nix/profile.cc')
-rw-r--r--src/nix/profile.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nix/profile.cc b/src/nix/profile.cc
index f3b73f10d..b0cedb24a 100644
--- a/src/nix/profile.cc
+++ b/src/nix/profile.cc
@@ -655,10 +655,16 @@ struct CmdProfileList : virtual EvalCommand, virtual StoreCommand, MixDefaultPro
for (size_t i = 0; i < manifest.elements.size(); ++i) {
auto & element(manifest.elements[i]);
- logger->cout("%d %s %s %s", i,
- element.source ? element.source->originalRef.to_string() + "#" + element.source->attrPath + element.source->outputs.to_string() : "-",
- element.source ? element.source->resolvedRef.to_string() + "#" + element.source->attrPath + element.source->outputs.to_string() : "-",
- concatStringsSep(" ", store->printStorePathSet(element.storePaths)));
+ if (i) logger->cout("");
+ logger->cout("Index: " ANSI_BOLD "%s" ANSI_NORMAL "%s",
+ i,
+ element.active ? "" : " " ANSI_RED "(inactive)" ANSI_NORMAL);
+ if (element.source) {
+ logger->cout("Flake attribute: %s%s", element.source->attrPath, element.source->outputs.to_string());
+ logger->cout("Original flake URL: %s", element.source->originalRef.to_string());
+ logger->cout("Locked flake URL: %s", element.source->resolvedRef.to_string());
+ }
+ logger->cout("Store paths: %s", concatStringsSep(" ", store->printStorePathSet(element.storePaths)));
}
}
};