LinuxmacOS

Where Is the Nix Store?

The Nix store, profiles and config files on Linux and macOS, and why you must never move the store.

Last updated

Every Nix package unpacks to /nix/store under a hash addressed path, identically on Linux and macOS (the Mac installer creates a synthetic APFS volume for it). Your environment is a symlink farm: ~/.nix-profile points into /nix/var/nix/profiles, with per user profiles beneath.

Never relocate /nix by hand; the hash addressing breaks and the whole store goes incoherent. Settings split three ways: /etc/nix/nix.conf for the daemon, ~/.config/nix/nix.conf for per user options like flakes and tokens. Enabling use-xdg-base-directories moves the profile links and surprises tools expecting the old ones.

Where Nix stores this, by platform

Linux
/nix/store

Immutable package outputs (/nix/store/<hash>-<name>). Profiles in /nix/var/nix/profiles (per user under per-user/<user>). Daemon config /etc/nix/nix.conf, user config ~/.config/nix/nix.conf. Logs in /nix/var/log/nix/drvs.

macOS
/nix/store

Same layout as Linux; the installer provisions a synthetic APFS volume for /nix. Same profile and config split (daemon vs ~/.config/nix/nix.conf). No native Windows support; use WSL paths inside a distro.

Frequently asked questions

Can I move the Nix store to a bigger disk?

Not by copying. Relocating breaks hash integrity, so reclaim space with nix-collect-garbage instead, or reinstall choosing a custom store at build time. Treat /nix as fixed for the life of the install.

Why is the nix command not found after installing?

The shell init is missing. Source /nix/etc/profile.d/nix.sh (or add ~/.nix-profile/bin to PATH) so the profile links resolve. Multi user installs need the build users group and daemon running too.

Notice an outdated path? Let us know.