2020-12-08 18:16:23 +02:00
|
|
|
R""(
|
|
|
|
|
|
|
|
# Examples
|
|
|
|
|
|
|
|
* Start a shell providing `youtube-dl` from the `nixpkgs` flake:
|
|
|
|
|
|
|
|
```console
|
|
|
|
# nix shell nixpkgs#youtube-dl
|
|
|
|
# youtube-dl --version
|
|
|
|
2020.11.01.1
|
|
|
|
```
|
|
|
|
|
|
|
|
* Start a shell providing GNU Hello from NixOS 20.03:
|
|
|
|
|
|
|
|
```console
|
|
|
|
# nix shell nixpkgs/nixos-20.03#hello
|
|
|
|
```
|
|
|
|
|
|
|
|
* Run GNU Hello:
|
|
|
|
|
|
|
|
```console
|
|
|
|
# nix shell nixpkgs#hello -c hello --greeting 'Hi everybody!'
|
|
|
|
Hi everybody!
|
|
|
|
```
|
|
|
|
|
2022-07-20 15:53:03 +03:00
|
|
|
* Run multiple commands in a shell environment:
|
|
|
|
|
|
|
|
```console
|
|
|
|
# nix shell nixpkgs#gnumake -c /bin/sh -c "cd src && make"
|
|
|
|
```
|
|
|
|
|
2020-12-08 18:16:23 +02:00
|
|
|
* Run GNU Hello in a chroot store:
|
|
|
|
|
|
|
|
```console
|
|
|
|
# nix shell --store ~/my-nix nixpkgs#hello -c hello
|
|
|
|
```
|
|
|
|
|
|
|
|
* Start a shell providing GNU Hello in a chroot store:
|
|
|
|
|
|
|
|
```console
|
|
|
|
# nix shell --store ~/my-nix nixpkgs#hello nixpkgs#bashInteractive -c bash
|
|
|
|
```
|
|
|
|
|
|
|
|
Note that it's necessary to specify `bash` explicitly because your
|
|
|
|
default shell (e.g. `/bin/bash`) generally will not exist in the
|
|
|
|
chroot.
|
|
|
|
|
|
|
|
# Description
|
|
|
|
|
2021-12-16 09:40:37 +02:00
|
|
|
`nix shell` runs a command in an environment in which the `$PATH` variable
|
|
|
|
provides the specified *installables*. If no command is specified, it starts the
|
|
|
|
default shell of your user account specified by `$SHELL`.
|
2020-12-08 18:16:23 +02:00
|
|
|
|
|
|
|
)""
|