Hacker News new | ask | show | jobs
by otabdeveloper4 1564 days ago
Nix is not a Linux distribution. Nix is like a kind of Docker from an alternative universe.

Or maybe "Python venv on massive steroids".

3 comments

to preface, I'm not saying that you don't know this, but maybe for others:

gentoo is not a linux distro either (from a certain point of view), more a meta-distribution, where you use the package manager (portage) to build everything from source.

fun fact: docker uses alpine linux, which for a while was a gentoo build, until it got to a point where it could bootstrap itself.

Nix is very often used for running CI/CD and as a build system for software artifacts. I don't think anybody uses Gentoo for this.
> Nix is like a kind of Docker from an alternative universe.

Nix is often compared to Docker, but Docker is essentially just a way to run programs (in a sandbox). Saying "I'll build it with Docker" says how you're going to run it, but not what you're going to run. Unfortunately, the "what" usually turns out to be a shell script, which runs one package manager to fetch another package manager, downloads a bunch of files from some random URLs, etc.

Nix is all about keeping careful track of the dependencies between things, such that all the fetching has been done by the time our scripts start (access to the network, and any paths outside the build sandbox, is disabled by default).

Also, the way Docker tends to be used involves downloading an entire Linux distro, just to run those scripts. Nix does the opposite: scripts only have access to precisely what they've asked for.

True, though NixOS is a linux distribution, if you want to go that way.