{"id":14235652,"url":"https://github.com/cdepillabout/nix-query-tree-viewer","last_synced_at":"2025-08-20T03:31:10.413Z","repository":{"id":47169002,"uuid":"237334390","full_name":"cdepillabout/nix-query-tree-viewer","owner":"cdepillabout","description":"GTK viewer for the output of `nix-store --query --tree`","archived":false,"fork":false,"pushed_at":"2024-03-10T20:17:13.000Z","size":468,"stargazers_count":69,"open_issues_count":5,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-15T12:37:56.129Z","etag":null,"topics":["gtk","gui","hacktoberfest","nix","nix-store","pretty","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/nix-query-tree-viewer","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdepillabout.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-31T00:42:50.000Z","updated_at":"2024-10-09T07:38:28.000Z","dependencies_parsed_at":"2022-09-19T02:01:46.585Z","dependency_job_id":null,"html_url":"https://github.com/cdepillabout/nix-query-tree-viewer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fnix-query-tree-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fnix-query-tree-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fnix-query-tree-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fnix-query-tree-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdepillabout","download_url":"https://codeload.github.com/cdepillabout/nix-query-tree-viewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230388131,"owners_count":18217755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gtk","gui","hacktoberfest","nix","nix-store","pretty","rust"],"created_at":"2024-08-20T21:02:12.663Z","updated_at":"2024-12-19T06:09:24.794Z","avatar_url":"https://github.com/cdepillabout.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# nix-query-tree-viewer\n\n[![Actions Status](https://github.com/cdepillabout/nix-query-tree-viewer/workflows/Test/badge.svg)](https://github.com/cdepillabout/nix-query-tree-viewer/actions)\n[![crates.io](https://img.shields.io/crates/v/nix-query-tree-viewer.svg)](https://crates.io/crates/nix-query-tree-viewer)\n[![dependency status](https://deps.rs/repo/github/cdepillabout/nix-query-tree-viewer/status.svg)](https://deps.rs/repo/github/cdepillabout/nix-query-tree-viewer)\n![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)\n\n`nix-query-tree-viewer` is a convenient way to visualize the output of\nthe dependencies of a given path in the Nix store.\n\n![image of nix-query-tree-viewer](./imgs/screenshot.png)\n\nThis is the same tree information that `nix-store --query --tree \u003cPATH\u003e` outputs,\nbut `nix-query-tree-viewer` makes it easier to understand and interact with.\n\n## Usage\n\nYou can run `nix-query-tree-viewer` by passing it a path in the Nix store:\n\n```console\n$ nix-query-tree-viewer /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0\n```\n\n## Installing\n\n`nix-query-tree-viewer` can be installed with either Nix or Cargo.\n\nInstalling with `nix-env`:\n\n```console\n$ nix-env -f channel:nixos-unstable -iA nix-query-tree-viewer\n```\n\nThis is convenient if you just want to use `nix-query-tree-viewer`.\n\nInstalling with `cargo`:\n\n```console\n$ cargo install nix-query-tree-viewer\n```\n\nYou'll need to have GTK libraries available in your environment for this to work.\n\n## Why use `nix-query-tree-viewer`?\n\nThe command `nix-store --query --tree` can be used to see the dependencies of a\npath in the Nix store in a tree format:\n\n```console\n$ nix-store --query --tree /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0\n/nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0\n+---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27\n|   +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...]\n+---/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23\n|   +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...]\n|   +---/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23 [...]\n+---/nix/store/hlnxw4k6931bachvg5sv0cyaissimswb-gcc-7.4.0-lib\n|   +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...]\n|   +---/nix/store/hlnxw4k6931bachvg5sv0cyaissimswb-gcc-7.4.0-lib [...]\n+---/nix/store/f5wl80zkrd3fc1jxsljmnpn7y02lz6v1-glibc-2.27-bin\n|   +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...]\n...\n```\n\nThis is fine for simple derivations, but it gets very complicated for paths\nwith deep dependency trees.\n\n`nix-query-tree-viewer` helps with this by folding branches of the tree by\ndefault.  Clicking on a branch allows you to drill down into interesting\nbranches.\n\nFor example, here is the same picture as above, but with two of the branches\nopen:\n\n![image of nix-query-tree-viewer with two branches open](./imgs/screenshot2.png)\n\n## Finding Paths for Derivations\n\nYou can use `nix-build` and `nix-instantiate` to easily find the paths for\nderivations.\n\nFor instance, if you want to find the path of `gcc` in the Nix store, you can\nuse `nix-build`:\n\n```console\n$ nix-build '\u003cnixpkgs\u003e' -A gcc --no-out-link\n...\n/nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0\n```\n\nIf you want to find the path of the `.drv` file for `gcc`, you can use\n`nix-instantiate`:\n\n```console\n$ nix-instantiate '\u003cnixpkgs\u003e' -A gcc\n...\n/nix/store/dyxdjxyszmlz29mb0jr9qkncj5l41dai-gcc-wrapper-7.4.0.drv\n```\n\nYou should be able to pass both\n`/nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0` and\n`/nix/store/dyxdjxyszmlz29mb0jr9qkncj5l41dai-gcc-wrapper-7.4.0.drv` to `nix-query-tree-viewer`.\n\nIn general, passing the output of `nix-build` to `nix-query-tree-viewer` will\nlet you see the run-time dependencies of a derivation, while passing the output\nof `nix-instantiate` will let you see the build-time dependencies of a\nderivation.\n\n## Contributions\n\nFeel free to open an issue or PR for any\nbugs/problems/suggestions/improvements.\n\n## Development\n\nYou can get into a development environment by running `nix-shell`.\n\nThis `nix-shell` provides the necessary system libraries for building, as well\nas `rustup`.\n\n`rustup` can be used to fetch the latest Rust compiler, as well as related\ntools:\n\n```console\n$ rustup toolchain install 1.55.0\n```\n\nYou should now have `cargo` and `rustc`, which can be used for building the project:\n\n```console\n$ cargo build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdepillabout%2Fnix-query-tree-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdepillabout%2Fnix-query-tree-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdepillabout%2Fnix-query-tree-viewer/lists"}