nix/doc/manual/source/quick-start.md

44 lines
1.1 KiB
Markdown
Raw Normal View History

2020-07-22 11:51:11 +00: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 11:51:11 +00:00
1. Install Nix:
2020-07-22 11:51:11 +00:00
2020-07-31 13:43:25 +00:00
```console
$ curl -L https://nixos.org/nix/install | sh
2020-07-31 13:43:25 +00:00
```
2020-07-22 11:51:11 +00:00
The install script will use `sudo`, so make sure you have sufficient rights.
For other installation methods, see the detailed [installation instructions](installation/index.md).
2020-07-22 11:51:11 +00:00
1. Run software without installing it permanently:
2020-07-22 11:51:11 +00:00
2020-07-31 13:43:25 +00:00
```console
$ nix-shell --packages cowsay lolcat
2020-07-31 13:43:25 +00:00
```
2020-07-22 11:51:11 +00: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 11:51:11 +00:00
2020-07-31 13:43:25 +00:00
```console
[nix-shell:~]$ cowsay Hello, Nix! | lolcat
2020-07-31 13:43:25 +00:00
```
2020-07-22 11:51:11 +00:00
Exiting the shell will make the programs disappear again:
2020-07-22 11:51:11 +00:00
2020-07-31 13:43:25 +00:00
```console
[nix-shell:~]$ exit
$ lolcat
lolcat: command not found
2020-07-31 13:43:25 +00:00
```
2020-07-22 11:51:11 +00:00
1. Search for more packages on [search.nixos.org](https://search.nixos.org/) to try them out.
2020-07-22 11:51:11 +00:00
1. Free up storage space:
2020-07-22 11:51:11 +00:00
2020-07-31 13:43:25 +00:00
```console
$ nix-collect-garbage
2020-07-31 13:43:25 +00:00
```