Essentially, Nix is a build tool and/or package manager that provides a lot of baseline guarantees about determinism and dependency (not runtime!) isolation and rollbacks and so on.
NixOS is a distro/OS built on top of Nix, which extends this model to not only packages, but the entire system configuration, bootloader, local container management, and so on.