anchor.diff:          Enable kernel modesetting when using the NVIDIA proprietary driver.
   
           Enabling this fixes screen tearing when using Optimus via PRIME (see
  -        <option>hardware.nvidia.optimus_prime.enable</option>. This is not enabled
  +        <option>hardware.nvidia.prime.sync.enable</option>. This is not enabled
           by default because it is not officially supported by NVIDIA and would not
           work with SLI.
         '';
       };
   
  -    hardware.nvidia.optimus_prime.enable = mkOption {
  +    hardware.nvidia.prime.sync.enable = mkOption {
         type = types.bool;
         default = false;
         description = ''
  
positive.code:       '';
      };
  
      hardware.nvidia.optimus_prime.allowExternalGpu = mkOption {
        type = types.bool;
        default = false;
        description = ''
  
negative.code:     services.xserver.drivers = singleton {
        name = "nvidia";
        modules = [ nvidia_x11.bin ];
        deviceSection = optionalString syncCfg.enable
          ''
            BusID "${syncCfg.nvidiaBusId}"
            ${optionalString syncCfg.allowExternalGpu "Option \"AllowExternalGpus\""}
          '';
        screenSection =
          ''
            Option "RandRRotation" "on"
            ${optionalString syncCfg.enable "Option \"AllowEmptyInitialConfiguration\""}
          '';
      };
  
      services.xserver.extraConfig = optionalString syncCfg.enable
        ''
          Section "Device"
            Identifier "nvidia-optimus-intel"
            Driver "modesetting"
            BusID  "${syncCfg.intelBusId}"
            Option "AccelMethod" "none"
          EndSection
        '';
      services.xserver.serverLayoutSection = optionalString syncCfg.enable
        ''
          Inactive "nvidia-optimus-intel"
        '';
  
      services.xserver.displayManager.setupCommands = optionalString syncCfg.enable ''
        # Added by nvidia configuration module for Optimus/PRIME.
        ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource modesetting NVIDIA-0
        ${pkgs.xorg.xrandr}/bin/xrandr --auto
  