niv icon indicating copy to clipboard operation
niv copied to clipboard

[feature] `init` option to create a tiny shell.nix skeleton

Open purcell opened this issue 3 years ago • 2 comments

Just a little suggestion here:

I (and at least one of my colleagues) often create ad-hoc nix shells for existing and new projects, and would love it if we could effectively bootstrap a little nix project environment that uses niv using niv init --shell or similar. If --shell is provided and there is no existing shell.nix, a tiny shell.nix template that gets its packages from niv's nixpkgs would be created.

I know this is probably somewhat orthogonal to the tool's goals, and of course what constitutes a "good" shell.nix is a matter of opinion, but I think this would be a real timesaver for many users.

Thanks again for niv!

purcell avatar Apr 12 '21 01:04 purcell

Just replace <nixpkgs> in your inputs with import (import ./nix/sources.nix).nixpkgs { }

SuperSandro2000 avatar Apr 12 '21 22:04 SuperSandro2000

Well yes, I know enough to be able to do that! But I think there's still a case for a drop-dead-simple project bootstrap.

purcell avatar Apr 12 '21 22:04 purcell