gitwtfhub

wtf is onix?

tobi/onix — explained in plain English

Analysis updated 2026-07-21 · repo last pushed 2026-02-13

8RubyAudience · developerComplexity · 4/5MaintainedSetup · hard

TL;DR

Onix converts a Ruby Gemfile.lock into reproducible, cacheable Nix builds so every machine builds gems identically. Build once, cache forever, same lockfile and Nix setup means identical results everywhere.

Mindmap

mindmap
  root((repo))
    What it does
      Reads Gemfile.lock
      Generates Nix build files
      Builds gems in parallel
      Caches each gem separately
    Key features
      Reproducible builds
      Shared system libraries
      Per-gem caching
      Overlay system for special gems
    Use cases
      Rails team CI caching
      Cross-machine consistency
      Native extension handling
    Tech stack
      Ruby
      Nix
      Bundler lockfiles
    Audience
      Ruby teams using Nix
      DevOps engineers
      Rails shops
    Tradeoffs
      Requires Nix installed
      Needs Ruby 3.1 plus
      Setup overhead

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Import a Rails Gemfile.lock and share pre-built gems across all developers and CI via a shared cache.

REASON 2

Handle gems with native C extensions like Nokogiri by linking them to shared system libraries instead of bundled copies.

REASON 3

Create overlay files for gems needing special build steps such as Rust-based extensions.

REASON 4

Achieve identical gem builds on every machine without abandoning your existing Bundler lockfile workflow.

What's in the stack?

RubyNixBundler

How it stacks up

tobi/onixmitchellh/minitest-speedpatriciomacadden/icd
Stars888
LanguageRubyRubyRuby
Last pushed2026-02-132011-09-152015-12-02
MaintenanceMaintainedDormantDormant
Setup difficultyhardeasyeasy
Complexity4/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires Nix installed plus Ruby 3.1 or newer, and you need a Gemfile.lock to start with.

Wtf does this do

Onix turns your Ruby project's dependency lockfile into reproducible, cacheable builds. Instead of relying on Bundler to assemble gems differently on every machine, you feed your existing lockfile in and get a set of packages that build identically everywhere, your laptop, CI, or a teammate's setup all share the same cache. The tool works in four steps. You run onix import to read a Gemfile.lock and convert it into a structured packageset file. Then onix generate fetches cryptographic hashes for every gem and writes out Nix build files, one per gem, plus one per project. onix build compiles everything in parallel. When a gem that needs system libraries fails, the tool tells you exactly which overlay file to create to fix it. Ruby gems with native C extensions (like Nokogiri or sqlite3) often bundle their own copies of libraries like OpenSSL or libxml2, which can cause version conflicts and security headaches. This project forces those gems to link against shared system libraries provided by Nix instead, replacing vendored copies. Each gem gets its own individually cacheable build, so if your lockfile and Nix setup stay the same, you never rebuild a gem twice. This is for Ruby teams already using or interested in Nix who want hermetic builds without abandoning Bundler's lockfile workflow. A Rails shop could import their Gemfile.lock, generate the build files once, and have every developer and CI pipeline pull pre-built gems from a shared cache. The overlay system lets you handle gems that need special treatment, like Rust-based extensions or gems with unusual build steps. The project makes a clear tradeoff: it requires Nix and at least Ruby 3.1, which adds setup overhead. But in return, you get builds that are fully reproducible and a caching model where "build once, cache forever" is literally true, same lockfile plus same nixpkgs equals identical store paths across machines.

Yoink these prompts

Prompt 1
I have a Ruby project with a Gemfile.lock and Nix installed. Walk me through running onix import, onix generate, and onix build step by step, including what files get created at each stage.
Prompt 2
A gem in my Onix build fails because it needs a system library that Nix is not providing. How do I create an overlay file to fix this, and where does it go?
Prompt 3
Help me set up shared caching for my Ruby team using Onix so that once a gem is built it never gets rebuilt on other machines or in CI. What Nix cache configuration is needed?

Frequently asked questions

wtf is onix?

Onix converts a Ruby Gemfile.lock into reproducible, cacheable Nix builds so every machine builds gems identically. Build once, cache forever, same lockfile and Nix setup means identical results everywhere.

What language is onix written in?

Mainly Ruby. The stack also includes Ruby, Nix, Bundler.

Is onix actively maintained?

Maintained — commit in last 6 months (last push 2026-02-13).

How hard is onix to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is onix for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.