Hacker News new | ask | show | jobs
by ParetoOptimal 1206 days ago
> Where does it say you shouldn't use nix-env, niv or shell.nix in 2023?

It's not in official documentation but the biggest reason is it's not reproducible by default and a new user could easily not pin nixpkgs, then think "wait... Nix isn't reproducible".

nix-shell and niv or otherwise pinning nixpkgs is pretty good, though there are some reproducibility advantages flakes has over nix-shell + niv such as:

- not allowing access to files not tracked in the git repo - forcing the user to lock their inputs with flake.lock whereas pinning/niv are optional

Also see: https://nixos.wiki/wiki/Flakes#Making_your_evaluations_pure