Three ways to smuggle SQLite into Nix

The author explores methods to integrate SQLite into the Nix package manager to overcome the performance limitations of parsing large JSON files. The project aims to improve data handling efficiency for the nixpkgs-multiverse index.
Why it matters
Optimizing package management data structures is essential for maintaining the scalability of large-scale software distribution systems.
The core of nixpkgs-multiverse , when you strip away the Nix API and the CLI, is an index. It is a map from (attribute, version) to the revision that shipped it as a JSON file. 1 1 There are actually a few other files that drive other features such as the statistics or “fast mode” , but they are all JSON as well.
$ ls -lh index/ -rw-r--r--. 1 fmzakari fmzakari 7.5M Aug 19 13:57 history.json -rw-r--r--. 1 fmzakari fmzakari 5.3M Aug 19 13:57 versions.json As of 9cc0209 , versions.json is 5.3 MiB and history.json is 7.5MiB covering 305,492 package versions across 31,904 packages and 1,534 revisions.
The Nix API loads the JSON files lazily and are all read via builtins.fromJSON :
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in