Pretty much. Both are just a way to tell nix about a build environment created with e.g. pkgs.mkShell
. I refer to this concept as a “nix shell” regardless of whether you index it with a flake or use an explicit shell.nix
file.
The ultimate work nix does does not meaningfully differ whether you use a flake.nix
file or if you spread your nix expressions into the traditional “standard” file tree.
Flakes’ raison d’être is precisely that there was no good standard for how to structure projects using nix - the flake.nix
file is a rough standard for that.
There are some subtle differences, the nix develop
command invokes the shell slightly differently (leading to some limitations), and since flakes enforce input locking your shells never update with your system - which can be both good and bad, depending on your use case. But it’s pretty much the same idea save for little details.
Flakes also add a better dependency resolution system than channels (though this can be solved without language additions, see e.g. npins) and the silly project copy thing to assert build purity in the least efficient way imaginable.