simple haskell code that builds a graph from the nix store
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
data
src
test
.gitignore
ChangeLog.md
LICENSE
README.md
Setup.hs
build-store.sh
default.nix
nixpkgs.nix
package.yaml
stack.yaml

README.md

store-graph

disclaimer: the code is not very clean but usuable. This was a quick experiment.

to evaluate nixpkgs in the repository root directory run (usually takes <5min):

NIX_STORE_DIR=$(pwd)/store NIX_STATE_DIR=$(pwd)/tmp nix-instantiate default.nix -A filtered

to produce a graph, stored in out.dot, and the adjacency matrix of the graph, stored in out.map, run:

stack build
stack exec -- store-graph-exe ./store/

The blog post data is included in the data folder. Unfortunately I didn't save the exact nixpkgs revision that I used to generate it. If you rerun the program, you might get slightly different results because it will be generated for the nixpkgs revision that is saved in nixpkgs.nix.