The nixos.org website suggests to use:
sh <(curl -L https://nixos.org/nix/install)For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volumeThat's it!
Now we can use nix as usual:
nix build -L '(import <nixpkgs> {}).hello.overrideAttrs (_: { HELLO = "WORLD"; })'or
nix-shell -p haskell.compiler.ghc882should just work.