Urgent.News

What's breaking now, across thousands of outlets.

Tech

nixpkgs-multiverse: every version that ever existed

The Nixpkgs multiverse is a single flake input that provides access to every version of every package that has ever existed in the Nixpkgs repository. The user experienced issues when a dependency they relied on was version bumped, breaking their tooling. To circumvent this, they added another nixpkgs input pinned to a specific commit, but this became cumbersome as they needed to search for and pin specific versions of packages.

To simplify this process, the author created the nixpkgs-multiverse, which consolidates all versions of packages into a single flake input. This allows users to query the flake for all versions of a package that have existed in Nixpkgs, and mix them together in a single shell, package, or build environment. The concept of a Nixpkgs input being distinct from a flake input is illustrated, with the author noting that each Nixpkgs input creates a separate universe.

The multiverse eliminates the need for flake inputs that are eagerly fetched even if not used, and instead fetches revisions lazily, only when needed. This results in a more efficient and manageable way to access historical versions of packages. The author emphasizes that every version of every package is already available, it's just a matter of addressing them by version number instead of commit hash.

The entire project is a mere 5 MB of JSON and about 200 lines of Nix code, making it a simple yet powerful solution to managing package versions in Nixpkgs.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at fzakaria.com →

More in Tech

Postgres Full-Text Search in Production: How to Load-Test the Index and Pin Down Relevance

Adding full-text search to Postgres is a two-line migration. Running it in production without surprises is not. The GIN index that makes search fast also adds write amplification and a background…

  • GIN index accelerates searches but increases write amplification in PostgreSQL.
  • Load testing required to validate search capabilities under real write rates.
  • Relevance contract measures configuration changes and defines expected query results.

More from Sunday 9 August →