LinuxCommandLibrary

nix-shell

creates temporary development environments

TLDR

Enter shell with package

$ nix-shell -p [hello]
copy
Enter shell from default.nix
$ nix-shell
copy
Enter shell from file
$ nix-shell [shell.nix]
copy
Run command in shell
$ nix-shell -p [jq] --run "[jq --version]"
copy
Pure shell
$ nix-shell --pure -p [python3]
copy
Multiple packages
$ nix-shell -p [python3] [nodejs] [git]
copy

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community