tweag / nixpkgs-graph-explorer

Explore the nixpkgs dependency graph
MIT License
15 stars 0 forks source link

Extract data for any flake #55

Closed zz1874 closed 1 year ago

zz1874 commented 1 year ago

This PR modifies the process of extracting of nix data by allowing that we can input a specific flake and scan for all available packages in nixpkgs to get the raw data of the flake.

The attribute of the flake outputs can be packages, defaultPackage or legacyPackages, and we've covered these three situations. If none of these attributes are in the outputs, we will get a blank list. We need to specify the system of the flake to get the data via TARGET_FLAKE_SYSTEM.

For example, for the whole nixpkgs repo, we can use

NIXPKGS_ALLOW_BROKEN=1 NIXPKGS_ALLOW_INSECURE=1 TARGET_FLAKE_REF="github:nixos/nixpkgs/master" TARGET_FLAKE_SYSTEM="x86_64-linux" nix eval --json --file "./nixpkgs-graph.nix"

Fixes #47