# Nix-shell, nix shell and nix develop

**URL:** https://discourse.nixos.org/t/nix-shell-nix-shell-and-nix-develop/25964
**Category:** Help
**Created:** [March 2, 2023, 4:11pm UTC](https://discourse.nixos.org/t/nix-shell-nix-shell-and-nix-develop/25964 "2023-03-02T16:11:26Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![tejing](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tejing/32/4566_2.png) [@tejing](https://discourse.nixos.org/u/tejing)
#### Post date: [March 2, 2023, 9:00pm UTC](https://discourse.nixos.org/t/nix-shell-nix-shell-and-nix-develop/25964/4 "2023-03-02T21:00:44Z")

</div>

I think it’d be helpful to know the story here:

`nix-shell` was originally designed to debug derivation build processes. You hand it a derivation, and instead of building it, it drops you into a shell very similar to the derivation’s build env, so you can walk through the stdenv phases and explore what’s actually happening.

`nix-shell` turned out to have 2 other significant and unforseen usecases. Over time, features were added to support them:

- Making development environments. Rather than debugging a nix build, people would just work on their source code from within the shell. `pkgs.mkShell` was added to support this usecase.
- Temporarily getting access to a package. People would use `nix-shell` when they wanted to run something without actually permanently installing it. `nix-shell -p` made this much much easier.

When the flakes-centered CLI redesign came along, one of the things people wanted to do was split this up a bit:

- `nix shell` is built for that last usecase (temporary access to a package). All it does is add a package’s `bin` directory to `PATH`, without any of the development stuff. It also takes multiple package arguments, as that makes sense for this usecase. It’s similar to `nix-shell -p foo` when not used for development purposes, as it doesn’t do all the stdenv stuff that makes dev tools work properly, but `nix-shell -p` actually does.
- `nix develop` takes on the other 2 usecases (debugging derivation builds and development environments). Its argument is still the package whose build environment one wants to enter, and you can still use `pkgs.mkShell` to create a “package” with a build environment good for development work. It’s similar to `nix-shell -A foo`, `nix-shell foo.nix`, and `nix-shell`.

So there’s some replication of functionality because we’re in the middle of a CLI redesign which is still experimental (`nix shell` and `nix develop` are still experimental, so `nix-shell` is sticking around despite doing the same thing). There are also some unforseen usecases which we’re now trying to support in less hacky ways.

---

_[View the full topic](https://discourse.nixos.org/t/nix-shell-nix-shell-and-nix-develop/25964)._
