About Zero to Nix
What it is, why we made it, and how it fits into the Nix ecosystem
Zero to Nix is a highly opinionated learning resource for Nix created by Determinate Systems. We believe Zero to Nix fills a major gap for two reasons:
- We find most of the existing Nix documentation to be difficult to navigate for beginners. Sources like the Nixpkgs manual, the official website, Nix Pills, and semi-official sources like nix.dev are all great once you have a strong sense of how Nix works and what it provides. We encourage you to explore them and we even link them in many places in Zero to Nix. But together they can be daunting to the uninitiated, and we wanted to provide a gentle “front end” to the official documentation sources.
- We strongly believe that flakes are the future of Nix and that people onboarding into Nix should use them from the get-go. But flakes are currently marked as an experimental feature of Nix and are thus not discussed in any of the official Nix documentation sources (with the exception of the Wiki entry for flakes).
What’s opinionated about Zero to Nix
First, as mentioned above, Zero to Nix is opinionated because it advocates learning and using flakes and treating channels as deprecated. But Zero to Nix also deviates from official recommendations in that it recommends installing Nix using the Determinate Nix Installer rather than the official Nix installation script.
The Determinate Nix Installer, from Determinate Systems, differs from the official Nix installation script in several important ways:
- It installs Nix with flake support and the unified CLI feature already enabled rather than requiring users to enable those features.
- It stores a receipt for the install process at
/nix/receipt.json
. This receipt enables the Determinate Nix Installer to seamlessly uninstall Nix, whereas the official Nix installation script provides no offboarding path of this kind. - Much like Terraform/OpenTofu, the Determinate Nix Installer enables you to plan your installation using the
plan
command to see how the installer will change your system. We see this as an improvement over the official Nix installation script, which prompts you to approve changes but doesn’t present all changes. - The Determinate Nix Installer is written in Rust rather than a shell scripting language (the official installer is written in Bash). This has two key benefits:
- It makes the Determinate Nix Installer more portable across platforms.
- It enables the Determinate Nix Installer to parallelize CPU-intensive tasks, which can’t be achieved in a language like Bash.
- If the installation fails along the way for some reason, the Determinate Nix Installer can use its receipt to revert the changes that it has made, minimizing the likelihood that the Nix installation process leaves your system in an undesirable state.
There’s nothing wrong with the official Nix installation script—far from it!—and we don’t dissuade you from using it. But we feel pretty strongly that the Determinate Nix Installer is more likely to offer a smooth experience for newcomers.