anchor.diff:                # /bin/sh won't work.
                 binshDeps = pkgs.writeReferencesToFile config.system.build.binsh;
               in
  -              pkgs.runCommand "nix.conf" {extraOptions = config.nix.extraOptions; } ''
  +              pkgs.runCommand "nix.conf" {extraOptions = cfg.extraOptions; } ''
                   extraPaths=$(for i in $(cat ${binshDeps}); do if test -d $i; then echo $i; fi; done)
                   cat > $out <<END
                   # WARNING: this file is generated.
                   build-users-group = nixbld
  -                build-max-jobs = ${toString (config.nix.maxJobs)}
  -                build-use-chroot = ${if config.nix.useChroot then "true" else "false"}
  -                build-chroot-dirs = ${toString config.nix.chrootDirs} $(echo $extraPaths)
  +                build-max-jobs = ${toString (cfg.maxJobs)}
  +                build-use-chroot = ${if cfg.useChroot then "true" else "false"}
  +                build-chroot-dirs = ${toString cfg.chrootDirs} $(echo $extraPaths)
                   $extraOptions
                   END
                 '';
  
positive.code:         fi
        '';
  
      nix.envVars =
        ''
          export NIX_CONF_DIR=/etc/nix
  
          # Enable the copy-from-other-stores substituter, which allows builds
          # to be sped up by copying build results from remote Nix stores.  To
          # do this, mount the remote file system on a subdirectory of
          # /var/run/nix/remote-stores.
          export NIX_OTHER_STORES=/var/run/nix/remote-stores/*/nix
        '' # */
        + optionalString config.nix.distributedBuilds ''
          export NIX_BUILD_HOOK=${config.environment.nix}/libexec/nix/build-remote.pl
          export NIX_REMOTE_SYSTEMS=/etc/nix.machines
          export NIX_CURRENT_LOAD=/var/run/nix/current-load
        ''
        # !!! These should not be defined here, but in some general proxy configuration module!
        + optionalString (config.nix.proxy != "") ''
          export http_proxy=${config.nix.proxy}
          export https_proxy=${config.nix.proxy}
          export ftp_proxy=${config.nix.proxy}
        '';
  
      users.extraUsers = map makeNixBuildUser (range 1 config.nix.nrBuildUsers);
  
      system.activationScripts.nix = stringAfter [ "etc" "users" ]
        ''
  
negative.code:       # actually a shell script.
        envVars = mkOption {
          internal = true;
          default = {};
          type = types.attrs;
          description = "Environment variables used by Nix.";
        };
  
        nrBuildUsers = mkOption {
  