This is a rebase of most commits from #14766, resolving conflicts and a few other evaluation problems.
*** NixOS *** NixOS is a Linux distribution based on the purely functional package management system Nix. More information can be found at http://nixos.org/nixos and in the manual in doc/manual.