Nix/doc/manual/src/quick-start.md

45 lines
1.2 KiB
Markdown
Raw Normal View History

2020-07-22 13:51:11 +02:00
# Quick Start
This chapter is for impatient people who don't like reading documentation.
For more in-depth information you are kindly referred to subsequent chapters.
2020-07-22 13:51:11 +02:00
1. Install Nix:
2020-07-22 13:51:11 +02:00
2020-07-31 15:43:25 +02:00
```console
$ curl -L https://nixos.org/nix/install | sh
2020-07-31 15:43:25 +02:00
```
2020-07-22 13:51:11 +02:00
The install script will use `sudo`, so make sure you have sufficient rights.
On Linux, `--daemon` can be omitted for a single-user install.
For other installation methods, see the detailed [installation instructions](installation/index.md).
2020-07-22 13:51:11 +02:00
1. Run software without installing it permanently:
2020-07-22 13:51:11 +02:00
2020-07-31 15:43:25 +02:00
```console
$ nix-shell --packages cowsay lolcat
2020-07-31 15:43:25 +02:00
```
2020-07-22 13:51:11 +02:00
This downloads the specified packages with all their dependencies, and drops you into a Bash shell where the commands provided by those packages are present.
This will not affect your normal environment:
2020-07-22 13:51:11 +02:00
2020-07-31 15:43:25 +02:00
```console
[nix-shell:~]$ cowsay Hello, Nix! | lolcat
2020-07-31 15:43:25 +02:00
```
2020-07-22 13:51:11 +02:00
Exiting the shell will make the programs disappear again:
2020-07-22 13:51:11 +02:00
2020-07-31 15:43:25 +02:00
```console
[nix-shell:~]$ exit
$ lolcat
lolcat: command not found
2020-07-31 15:43:25 +02:00
```
2020-07-22 13:51:11 +02:00
1. Search for more packages on <search.nixos.org> to try them out.
2020-07-22 13:51:11 +02:00
1. Free up storage space:
2020-07-22 13:51:11 +02:00
2020-07-31 15:43:25 +02:00
```console
$ nix-collect-garbage
2020-07-31 15:43:25 +02:00
```