For me, all the websites and articles only talked about the advantages and wanted to sell nix to me. But I was already sold, I just didn't know how exactly it works.<p>Now, after many articles, I finally read the nix-pill about derivations. I realized, it's actually very simple: All the nix code evaluates to data structures called derivations. A derivation is a json-like data structure which has a few fields that describe how to build a package in the nix-store. Basically build time dependencies, runtime dependencies and a command to produce artifacts.
I read the nixpkgs definitions for my favorite packages, which cleared up quite a lot. Flakes are harder to grok due to how different they behave in different circumstances, but a lot of it will make sense once you grasp how Nix handles builds.<p>My suggestion - try writing a Flake or package file for a simple binary project. Adjusting that same "happy path" to work for other projects is usually as simple as Googling "nix flake $LANGUAGE template".