LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nix-shell.2

provides ad-hoc development environments

TLDR

Quick package shell
$ nix-shell -p [package]
copy
Shell with multiple packages
$ nix-shell -p [git] [curl] [jq]
copy
Execute and exit
$ nix-shell -p [ripgrep] --run "rg pattern"
copy
From expression
$ nix-shell -E "with import <nixpkgs> {}; mkShell { buildInputs = [hello]; }"
copy

SYNOPSIS

nix-shell [options]

DESCRIPTION

nix-shell provides ad-hoc development environments. This is alternate documentation.The tool is essential for quick environment setup. No permanent changes.

PARAMETERS

-p PKG

Add package to shell.
--run CMD
Run command and exit.
-E EXPR
Evaluate expression.
--help
Display help information.

CAVEATS

Downloads packages. Network required. Uses Nix store.

HISTORY

nix-shell is a foundational Nix tool for reproducible development environments.

SEE ALSO

Copied to clipboard
Kai