{"id":13646995,"url":"https://github.com/utdemir/nix-tree","last_synced_at":"2025-12-11T23:20:00.148Z","repository":{"id":40990138,"uuid":"274783212","full_name":"utdemir/nix-tree","owner":"utdemir","description":"Interactively browse dependency graphs of Nix derivations.","archived":false,"fork":false,"pushed_at":"2025-04-01T00:34:20.000Z","size":270,"stargazers_count":836,"open_issues_count":13,"forks_count":17,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-24T07:55:50.548Z","etag":null,"topics":["dependency-graph","hacktoberfest","nix"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utdemir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-24T22:41:51.000Z","updated_at":"2025-04-23T17:31:56.000Z","dependencies_parsed_at":"2023-02-19T00:50:16.993Z","dependency_job_id":"88a44a92-92b9-4f28-95f7-3178002c258d","html_url":"https://github.com/utdemir/nix-tree","commit_stats":{"total_commits":201,"total_committers":11,"mean_commits":"18.272727272727273","dds":"0.12437810945273631","last_synced_commit":"22db2bf16ef0f0b4f5190a3034cbc5a9e3717caa"},"previous_names":["utdemir/nixdu"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utdemir%2Fnix-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utdemir%2Fnix-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utdemir%2Fnix-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utdemir%2Fnix-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utdemir","download_url":"https://codeload.github.com/utdemir/nix-tree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149942,"owners_count":22022851,"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":["dependency-graph","hacktoberfest","nix"],"created_at":"2024-08-02T01:03:17.912Z","updated_at":"2025-12-11T23:20:00.136Z","avatar_url":"https://github.com/utdemir.png","language":"Haskell","funding_links":[],"categories":["nix","Haskell","HarmonyOS","Command-Line Tools"],"sub_categories":["Windows Manager","Discovery"],"readme":"# nix-tree\n\n[![Build Status](https://github.com/utdemir/nix-tree/actions/workflows/build.yaml/badge.svg)](https://github.com/utdemir/nix-tree/actions/workflows/build.yaml)\n[![Packaging status](https://repology.org/badge/vertical-allrepos/haskell:nix-tree.svg?exclude_unsupported=1)](https://repology.org/project/haskell:nix-tree/versions)\n\nInteractively browse dependency graphs of Nix derivations.\n\n[![asciicast](https://asciinema.org/a/cnilbmPXW51g97hdNJZcM5F6h.svg)](https://asciinema.org/a/cnilbmPXW51g97hdNJZcM5F6h)\n\n## Installation\n\n`nix-tree` is on `nixpkgs` since `20.09`, so just use your preferred method for adding packages to your system, eg:\n\n```\nnix-env -iA nix-tree\n```\n\nOr, for flake enabled systems:\n\n```\nnix profile install 'nixpkgs#nix-tree'\n```\n\nTo run the current development version:\n\n```\nnix run github:utdemir/nix-tree -- --help\n```\n\n## Usage\n\n```console\n$ nix-tree --help\nUsage: nix-tree [INSTALLABLE] [--store STORE] [--file FILE] [--version] [--derivation] [--impure] [--dot]\n\n  Interactively browse dependency graphs of Nix derivations.\n\nAvailable options:\n  INSTALLABLE              A store path or a flake reference.\n                           Paths default to \"~/.nix-profile\" and \"/var/run/current-system\"\n  --store STORE            The URL of the Nix store, e.g. \"daemon\" or \"https://cache.nixos.org\"\n                           See \"nix help-stores\" for supported store types and settings.\n  --file FILE              Interpret installables as attribute paths relative to the Nix expression stored in file.\n  --version                Show the nix-tree version\n  --derivation             Operate on the store derivation rather than its outputs\n  --impure                 Allow access to mutable paths and repositories\n  --dot                    Print the dependency graph in dot format\n  -h,--help                Show this help text\n\nKeybindings:\n  hjkl/Arrow Keys : Navigate\n  w               : Open why-depends modal\n  /               : Open search modal\n  s               : Change sort order\n  y               : Yank selected path to clipboard\n  ?               : Show help\n  q/Esc           : Quit / close modal\n```\n\n### Glossary\n\n* **NAR Size**: Size of the store path itself.\n* **Closure size**: Total size of the store path and all its transitive dependencies.\n* **Added size**:  Size of the store path, and all its _unique_ transitive\n  dependencies. In other words, the cost of having that store path on top\n  of all other paths. See [issue #14] for a better explanation.\n\n[issue #14]: https://github.com/utdemir/nix-tree/issues/14\n\n### Tips\n\n`nix-build` prints built paths to stdout, which can be piped conveniently\nwith `| xargs -o nix-tree`. Examples:\n\n```bash\n# Output of a local derivation\nnix-build . --no-out-link | xargs -o nix-tree\n\n# Build time dependencies (passing a `.drv` path)\nnix-instantiate . | xargs -o nix-tree --derivation\n\n# Dependencies from shell.nix\nnix-build shell.nix -A inputDerivation | xargs -o nix-tree\n\n# All outputs of a derivation in nixpkgs\nnix-build '\u003cnixpkgs\u003e' -A openssl.all --no-out-link | xargs -o nix-tree\n```\n\n`nix-tree` also supports flake references:\n\n```bash\n# Build time dependencies of a flake on the current directory\nnix-tree --derivation '.#'\n\n# Same thing works for any flake reference\nnix-tree --derivation 'nixpkgs#asciiquarium'\n```\n\nRun `nix-tree` on your current nixos system:\n\n```bash\nnix-tree /nix/var/nix/profiles/system\n```\n\nRun `nix-tree` on a flake reference of a nixosConfiguration:\n\n```bash\nnix build --print-out-paths --no-link '.#nixosConfigurations.foo.config.system.build.toplevel'\nnix-tree '.#nixosConfigurations.foo.config.system.build.toplevel'\n```\n\nQuery the binary cache before download, with the `--store` option:\n\n```bash\n# Query the runtime dependency of `stellarium` (2 GiB closure) without download\nnix eval --raw 'nixpkgs#stellarium.outPath' | xargs -o nix-tree --store https://cache.nixos.org\n```\n\nFor valid `--store` options, see [`nix help-stores`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-help-stores). For example,\n\n```bash\n# Build in a temporary chroot store and examine the output\nnix build --store /tmp/chroot-store 'nixpkgs#hello' --print-out-paths | xargs -o nix-tree --store /tmp/chroot-store\n```\n\n## Contributing\n\nAll contributions, issues and feature requests are welcome.\n\nTo hack on it, simply run `nix-shell` and use `cabal` as usual. Please run `./format.sh` before sending a PR.\n\n## Related tools\n\n* [nix-du](https://github.com/symphorien/nix-du): Visualise which gc-roots to delete to free some space in your nix store\n* [nix-melt](https://github.com/nix-community/nix-melt): A ranger-like flake.lock viewer\n* [nix-query-tree-viewer](https://github.com/cdepillabout/nix-query-tree-viewer): GTK viewer for the output of `nix-store --query --tree`\n* [nix-visualize](https://github.com/craigmbooth/nix-visualize): Uses the Nix package manager to visualize the dependencies of a given package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futdemir%2Fnix-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futdemir%2Fnix-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futdemir%2Fnix-tree/lists"}