1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 14:32:43 -04:00
nix.dev/source/tutorials/install-nix.rst
2021-07-22 10:05:11 +02:00

44 lines
937 B
ReStructuredText

.. _install-nix:
Install Nix
===========
Install Nix on **any Linux distribution**, **MacOS** and **Windows (via WSL)**
via the recommended `multi-user installation <https://nixos.org/manual/nix/stable/#chap-installation>`_:
.. code:: bash
sh <(curl -L https://nixos.org/nix/install) --daemon
.. note::
For security you may want to `verify the installation script`_ using GPG signatures.
Verify installation
-------------------
Check that the installation was successful:
.. code:: bash
$ nix-env --version
nix-env (Nix) 2.3.6
.. _verify the installation script: https://nixos.org/download.html#nix-verify-installation
Use Docker to explore Nix
-------------------------
Start a Docker shell with Nix:
.. code:: bash
$ docker run -it nixos/nix
Or start a Docker shell with Nix exposing a ``workdir`` directory:
.. code:: bash
$ mkdir workdir
$ docker run -it -v $(pwd)/workdir:/workdir nixos/nix