Start by running the nix installer script:
sh <(curl -L https://nixos.org/nix/install) --daemon
In order to use flakes, you need to allow two experimental features:
mkdir ~/.config/nix
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
To activate the nix shell, run
nix develop
Or to have it automatically activated, install direnv and nix-direnv and create a .envrc
file containing the words use_flake
.