1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 00:06:26 -04:00

show nix-shell --run (#886)

* show nix-shell --run

it's quite useful and not necessarily obvious without reading reference documentation

Co-authored-by: Silvan Mosberger <github@infinisil.com>
This commit is contained in:
Valentin Gagarin 2024-01-29 02:41:04 +01:00 committed by GitHub
parent 5f1eea5bc2
commit cf94730f93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,6 +54,20 @@ $ echo all gone | lolcat
The program lolcat is currently not installed. The program lolcat is currently not installed.
``` ```
## Running programs once
You can go even faster, by running any program directly:
```console
$ nix-shell -p cowsay --run "cowsay Nix"
```
If the command consists only of the program name, no quotes are needed:
```console
$ nix-shell -p hello --run hello
```
## Search for packages ## Search for packages
What can you put in a shell environment? What can you put in a shell environment?