top | item 37107576

(no title)

sullyj3 | 2 years ago

I empathise with this uncertainty. As I understand it, flakes aren't incompatible with the previous way of doing things. Rather they represent an additional feature which can be used on top of them.

For example if you have a shell.nix that you were running with `nix-shell` which defaults to using channels to obtain nixpkgs

    { pkgs ? import <nixpkgs> {} }:
      pkgs.mkShell {
      # ...
You can reuse it in your flake.nix

    devShells.${system}.default = import ./shell.nix { inherit pkgs; };
And it will use the locked nixpkgs input defined in your flake. You can run it with the new `nix develop` command, but `nix-shell` will continue to work, giving you the previous behaviour.

discuss

order

No comments yet.