[Nix-dev] nix-shell (was: Python 3 as default)

Peter Simons simons at nospf.cryp.to
Tue Feb 14 18:44:42 CET 2017


Hi Profpatsch,

 >> I hardly ever use nix-shell and I don't want to, to be honest.
 >
 > Why is that?

1. I don't need it. Adding those Haskell/Python/LaTeX/R modules that I
   need into my global user environment works just fine. I suppose there
   might be occasions where versions conflict in a way that makes it
   impossible to add them into the same environment, but I haven't
   actually encountered that problem yet. Since I don't need more than
   one shell environment, I don't have to bother will shell.nix files,
   and I don't have to remember which open shell window is running which
   environment either.

2. nix-shells don't nest. And even if they would, many things you'll
   define inside of a nix-shell won't nest. Thus, you cannot easily
   compose shell environments, which makes it hard to define accurate
   environments in a modular and re-usable fashion.

3. nix-shell interacts poorly with long-running processes. I work on all
   my projects with Emacs, but I don't want to start Emacs inside of a
   nix-shell created for one particular project. My Emacs is up and
   running from the moment I log in and then I don't ever quit it unless
   I absolutely have to. So having a proper build environment in "some
   other window" isn't very useful to me. I want to compile by hitting
   C-c C-c or C-c C-l.

4. When I update my copy of the Nixpkgs repository, I run "nix-env -u
   --always" and afterwards everything I'll need to work on all of my
   projects is available locally in my /nix store. If I see that Nix
   needs to compile hundreds of packages to do the update, then I may or
   may not decide to postpone the update. When using nix-shell, I won't
   know whether it needs to compile for an hour until I've actually run
   it, i.e. I'll notice that I can't start hacking on some project only
   after I've decided I want to do that. With one global environment, I
   have that information for all my projects at the time I decide
   whether to update or not.

5. The default nix-shell prompt in bash does not distinguish between
   "root" and normal users. ;-)

Having said all that, I believe that nix-shell is genuinely useful and I
do use it every now and then. I wouldn't want to get along without it. I
just wouldn't want to use it as much as some people apparently do.

Best regards,
Peter



More information about the nix-dev mailing list