How to update nixpkgs?

After a reboot the command works:

joao@Joaos-MacBook-Pro ~ % nix-instantiate '<nixpkgs>' -A hello
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/vg2kr2hqr1b95s0wjz6nlaakh6vdsfaz-hello-2.12.1.drv

Reference: nix 2.0 on macOS High Sierra - error: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket' · Issue #1980 · NixOS/nix · GitHub