Currently, I am using Nix flakes with flake-parts to create a dev shell - but I feel like I’m not taking advantage of NixOS. Here’s why - the only thing that’s reproducible is the NodeJS version. The rest of the app package is managed by pnpm, and not by the flakes itself. Should I have just stayed with the simpler shell.nix
?
The only reason I switched to flakes is because I liked the new fancy Nix command nix develop
instead of the old nix-shell ./shell.nix
thingy. I know, silly reason.
If you want to use nix develop without flakes, you can use
nix develop -f shell.nix
. The benefit of flakes (or, well, pinning your nixpkgs for the project in general, flakes just make this easy) is that you can at any time in the future come back to the project and get a working setup instead of an incompatible Node version.(Though, I use flakes for my projects but often tell direnv to override nixpkgs with the system nixpkgs when evaluating the shell so everything is in sync (with the
--override-input nixpkgs nixpkgs
option). Mostly because it means less duplicate downloads and libraries in the store.)