anchor.diff:      };
     };
   
  -  config = mkIf enabled {
  +  config = let
  +      igpuDriver = if pCfg.intelBusId != "" then "modesetting" else "amdgpu";
  +      igpuBusId = if pCfg.intelBusId != "" then pCfg.intelBusId else pCfg.amdgpuBusId;
  +  in mkIf enabled {
       assertions = [
         {
           assertion = with config.services.xserver.displayManager; gdm.nvidiaWayland -> cfg.modesetting.enable;
  
positive.code:     };
  
      services.xserver.serverLayoutSection = optionalString syncCfg.enable ''
        Inactive "Device-modesetting[0]"
      '' + optionalString offloadCfg.enable ''
        Option "AllowNVIDIAGPUScreens"
      '';
  
      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
      '';
  
  
negative.code:       '';
      };
  
      hardware.nvidia.prime.amdgpuBusId = mkOption {
        type = types.str;
        default = "";
        example = "PCI:4:0:0";
        description = ''
          Bus ID of the AMD APU. You can find it using lspci; for example if lspci
  	shows the AMD APU at "04:00.0", set this option to "PCI:4:0:0".
        '';
      };
  
      hardware.nvidia.prime.sync.enable = mkOption {
        type = types.bool;
        default = false;
  