Installing nix
Install Nix (multi-user, recommended)
curl -L https://nixos.org/nix/install | sh -s -- --daemonFollow the prompts. When it finishes, restart your shell or source the environment:
. /etc/profile.d/nix.shEnable flakes (if not already enabled)
mkdir -p ~/.config/nixcat <<EOF >> ~/.config/nix/nix.confexperimental-features = nix-command flakesEOFValidate the Install
nix --versionThen:
nix shell nixpkgs#hello -c helloExpected output:
Hello, world!If you see that, Nix is working.
On macOS, the recommended way to install Nix is using the Determinate Systems installer. It installs upstream Nix, not a fork, and handles macOS-specific details cleanly.
This is the installer we will use for the workshop.
curl -fsSL https://install.determinate.systems/nix | sh -s -- install --use-upstream-nixYou’ll be prompted for your password to set up the daemon and launchd services.
Restart your terminal afterward.
Enable flakes
mkdir -p ~/.config/nixcat <<EOF >> ~/.config/nix/nix.confexperimental-features = nix-command flakesEOFValidate the Install
nix --versionThen:
nix shell nixpkgs#hello -c helloYou should see:
Hello, world!WSL (Ubuntu / Debian-based)
Section titled “WSL (Ubuntu / Debian-based)”Edit /etc/wsl.conf:
[boot]systemd=trueThen restart WSL from Windows:
wsl --shutdownReopen your WSL terminal.
Install Nixcurl -L https://nixos.org/nix/install | sh -s -- --daemonThen load the environment:
. /etc/profile.d/nix.shEnable flakes
mkdir -p ~/.config/nixcat <<EOF >> ~/.config/nix/nix.confexperimental-features = nix-command flakesEOFValidate the Install
nix --versionThen:
nix shell nixpkgs#hello -c helloExpected output:
Hello, world!