I started using NixOS as the sole operating system on my desktop PC about two months ago, so I’m a newbie with only rudimentary knowledge of the inner workings of Nix. I’m just an “average joe” user with no background in software development or system administration. I do have a background in Mathematics though, and that’s probably one of the reasons I like the unique functional, declarative and reproducible approach Nix takes. Let me share what helped me gain a basic first foothold in the NixOS world.
My mental concept of what Nix does (and how) is based on an analogy: for me, Nix is like cooking/baking. What do I mean by that? Well, I declare “I want a cheesecake” (a Nix expression) and Nix creates the shopping list as well as the recipe (the derivation) and then realizes that for me. Even if you enjoy baking, telling someone else that you want a cake is much simpler than doing it yourself (including buying the ingredients first). You don’t even need to know how to do it yourself. Expressing your will is enough. Nix is the same, you declare what you want and the system takes care of the rest. I like that! And I like the idea that my whole system is the result of a function that takes my needs as an argument.
The following is a selection of resources that helped me to understand and appreciate better what Nix is and does (in no particular order):
- The " NixOS & Flakes Book - An unofficial book for beginners" that @uep already mentioned
- A gentle introduction to Nix on YouTube, a talk that Bryan from Tweag held
- The Architecture and History of Nixpkgs on YouTube, a talk by Jon Ringer for the Summer of Nix 2022 Public Lecture Series not only on Nixpkgs but on the whole ecosystem
- A video about the basic configuration using Flakes on YouTube by some random guy
- The Nix from Nothing series by Jake Hamilton on YouTube
- The interactive Tour of Nix about the Nix language
- The official Manual and the Nix Reference Manual (seriously, there is well written and very helpful documentation already, despite the many and frequent complaints)