Skip to content

Instantly share code, notes, and snippets.

@johannes-jansson
Last active November 17, 2022 13:16
Show Gist options
  • Save johannes-jansson/a38011f053b146ebfd2595e5e01364ca to your computer and use it in GitHub Desktop.
Save johannes-jansson/a38011f053b146ebfd2595e5e01364ca to your computer and use it in GitHub Desktop.
Installing Nix on macOS

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment