mirror of
https://github.com/NixOS/nix.dev.git
synced 2024-10-18 14:32:43 -04:00
c22b9e139f
Nix releases aren not signed any more: https://github.com/NixOS/nix/pull/7411 nixos.org does not have the referenced section any more: https://github.com/NixOS/nixos-homepage/pull/975
1.7 KiB
1.7 KiB
(install-nix)=
Install Nix
:::::{tab-set}
::::{tab-item} Linux
Install Nix via the recommended multi-user installation:
$ curl -L https://nixos.org/nix/install | sh -s -- --daemon
::::
::::{tab-item} macOS
Install Nix via the recommended multi-user installation:
$ curl -L https://nixos.org/nix/install | sh
::::
::::{tab-item} Windows (WSL2)
Install Nix via the recommended single-user installation:
$ curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
However, if you have systemd support enabled, install Nix via the recommended multi-user installation:
$ curl -L https://nixos.org/nix/install | sh -s -- --daemon
::::
::::{tab-item} Docker
Start a Docker shell with Nix:
$ docker run -it nixos/nix
Or start a Docker shell with Nix exposing a workdir
directory:
$ mkdir workdir
$ docker run -it -v $(pwd)/workdir:/workdir nixos/nix
The workdir
example from above can be also used to start hacking on Nixpkgs:
$ git clone git@github.com:NixOS/nixpkgs
$ docker run -it -v $(pwd)/nixpkgs:/nixpkgs nixos/nix
bash-5.1# nix-build -I nixpkgs=/nixpkgs -A hello
bash-5.1# find ./result # this symlink points to the build package
::::
:::::
Verify installation
Check the installation by opening a new terminal and typing:
$ nix --version
nix (Nix) 2.11.0