nix-shell
creates temporary development environments
TLDR
Enter shell with package
$ nix-shell -p [hello]
Enter shell from default.nix$ nix-shell
Enter shell from file$ nix-shell [shell.nix]
Run command in shell$ nix-shell -p [jq] --run "[jq --version]"
Pure shell$ nix-shell --pure -p [python3]
Multiple packages$ nix-shell -p [python3] [nodejs] [git]
SYNOPSIS
nix-shell [options] [path]
DESCRIPTION
nix-shell creates temporary development environments. Provides packages without installing.
The tool sets up shell with dependencies. Exits cleanly without system changes.
PARAMETERS
PATH
Nix expression file.-p PACKAGES
Packages to include.--run CMD
Command to execute.--pure
Clear environment.-A ATTR
Use specific attribute.--help
Display help information.
CAVEATS
Legacy command. Consider nix develop. Per-invocation environment.
HISTORY
nix-shell is a core Nix command for creating temporary development shells.
SEE ALSO
nix-develop(1), nix(1), direnv(1)
