The easiest way is probably to do following:
git clone https://github.com/nixos/nixpkgs
cd nixpkgs
git checkout origin/nix-2.0
nix-env -i $(nix-build --no-out-link . -A nix)