One technology that I'd been hearing more and more over the last two years has been
Nix, in its various forms. The big draws I've heard about include declarative,
portable, cross lang dependency specification, and the ability to have a config file
declare the entire state of a system without storing huge docker container artifacts
for every permutation.
Actually learning Nix though felt much harder than it needed to be. The biggest problem
is that the documentation you need is often fragmented among the different subprojects,
and also the transition that Nix is in at the moment from the current standard methods
of default.nix
, configuration.nix
and shell.nix
to a new world of flakes
.
As an outsider looking in, the flake world felt kind of in limbo at the moment
where anyone I talked to indicated that flakes fix so many of the problems with
current nix, but also they're still officially experimental so the official documentation
declines to mention flakes.
After spending a fair amount of time understanding Nix for myself, I've decided to write my own guide
which explains it from scratch in a world using only the new Nix features,
with the nix
CLI and flakes for the use cases I want from Nix. Credit
to ianthehenry for his guide on Nix focused on the "old world" approach, and Xe Iaso
for explaining flakes. The information included in this guide
is largely from synthesising their blogs and the official documentation.
This first post will describe the major parts of the Nix ecosystem.
Read More