Forrest logo
back to the nix-shell tool

nix-classic:tldr:6bedc

nix-classic: Start a shell with the specified packages available.
$ nix-shell -p ${pkg1 pkg2 pkg3---}
try on your machine

The command nix-shell -p ${pkg1 pkg2 pkg3---} is used in the Nix package manager to create a shell environment with specific packages installed.

Here is a breakdown of the command:

  • nix-shell is a command that starts a subshell with the necessary environment variables and dependencies for a specific project.

  • -p is an option that tells nix-shell to install the specified packages in the environment.

  • ${pkg1 pkg2 pkg3---} is a placeholder for the packages you want to install. Replace pkg1, pkg2, pkg3, etc. with the desired package names. Multiple package names are separated by a space.

When you run this command, Nix will create a shell environment with the specified packages installed, making them available for use within that environment. This allows you to easily set up an isolated development or build environment with the necessary dependencies for a specific project.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nix-shell tool