Skip to content

Feature request: Display meta information #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DavHau opened this issue Nov 19, 2020 · 3 comments
Open

Feature request: Display meta information #9

DavHau opened this issue Nov 19, 2020 · 3 comments
Labels
design-needed enhancement New feature or request

Comments

@DavHau
Copy link

DavHau commented Nov 19, 2020

It would be nice if nix-tree would also display meta information for each package, like for example the license.

@utdemir
Copy link
Owner

utdemir commented Nov 19, 2020

Great idea! Just to start the brainstorming:

  • Should we simply have a "details" modal showing the meta information for the selected package, or is there any information we can/should show inline or in the modeline?
  • How do we get some useful metadata for store paths? The only thing nix-tree currently has access to is the metadata from nix path-info --json per every store path, but that doesn't contain much information:
% nix path-info --json /nix/store/zyvf9k2i8cma5pvb9mrvh7fsqjhbf5py-krb5-1.18 | jq .
[
  {
    "path": "/nix/store/zyvf9k2i8cma5pvb9mrvh7fsqjhbf5py-krb5-1.18",
    "narHash": "sha256-MKC140uRzp0Mvn5kZFKo1o/YKUtJJvt9n7eRc16gNCI=",
    "narSize": 4081944,
    "references": [
      "/nix/store/6rv3vhb87bgx7i205ngb4gz3gnzypnhl-keyutils-1.6.3-lib",
      "/nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g",
      "/nix/store/bdf8iipzya03h2amgfncqpclf6bmy3a1-glibc-2.32",
      "/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23",
      "/nix/store/sbfj9lhpfi5v9vwrdf9my8l1m7cwbi37-libedit-20191231-3.1",
      "/nix/store/zyvf9k2i8cma5pvb9mrvh7fsqjhbf5py-krb5-1.18"
    ],
    "registrationTime": 1603836913,
    "signatures": [
      "cache.nixos.org-1:XoTFbWjf7GsVJsATyMZDBF4DUl7k/V/9GL/PZp+hbX/nQ7uT7Pjr0W0F75FTIMSdp5AojKp88c/OpZXJQ6SqBg=="
    ]
  }
]

Do you know a way to obtain that license information or any other metadata given a store path?

@DavHau
Copy link
Author

DavHau commented Nov 24, 2020

I guess the bottom right corner of the screen could have enough space for it.

Getting the metadata could actually be a problem. The metadata is specified in the nixpkgs expression for every package and can be retrieved via pkgs.{package}.meta. But I don't know if there is a way to get the nix attribute for a store path.

Seems like the problem is a bit more complicated than originally thought.

@utdemir
Copy link
Owner

utdemir commented Nov 24, 2020

Getting the metadata could actually be a problem. The metadata is specified in the nixpkgs expression for every package and can be retrieved via pkgs.{package}.meta. But I don't know if there is a way to get the nix attribute for a store path.

Yeah, I couldn't find a solution for this either. I'm going to leave this issue open since I still think it would be a useful piece of information, and will come back to it if I can figure out a nice way. Please let me know if you can think of any!

Thanks again.

@utdemir utdemir added enhancement New feature or request design-needed labels Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-needed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants