With the new Nix command is there a way to use regular shell.nix files?

I have many shell.nix files sprawled throughout my directories where the off-chance of them not being reproducible is way less of an hassle than having to keep the flakes updated or risk downloading different year old GHC/etc. builds all the time. With the new Nix command I have looked for ways to have declarative Nix shells that use whatever version of Nixpkgs that was pinned by the system NixOS configuration. Is this functionality that is going away with the old nix-shell command?

You can continue using nix-shell, even when you enable flakes and nix-commands experimental features.

1 Like

Note that you can use the flake registry instead of pinning dependencies, which is more suited to flakes for devshells. Personally I think it’s worth doing for the speed of caching.

I’ve set my flake registry’s nixpkgs entry to be equal to what is running on my host, which makes a nixpkgs input in my flakes with no specified input in the input block resolve to whatever nixpkgs version I have on disk.

You can do that like this.

Hosted by Flying Circus.