anchor.diff:        source = "${nvidia_x11.bin}/share/nvidia/nvidia-application-profiles-rc";
       };
   
  -    hardware.opengl.package = nvidia_x11.out;
  -    hardware.opengl.package32 = nvidia_libs32;
  +    hardware.opengl.package = mkIf (!offloadCfg.enable) nvidia_x11.out;
  +    hardware.opengl.package32 = mkIf (!offloadCfg.enable) nvidia_libs32;
  +    hardware.opengl.extraPackages = optional offloadCfg.enable nvidia_x11.out;
  +    hardware.opengl.extraPackages32 = optional offloadCfg.enable nvidia_libs32;
   
       environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
         ++ filter (p: p != null) [ nvidia_x11.persistenced ];
  
positive.code:         Configure X to allow external NVIDIA GPUs when using optimus.
        '';
      };
    };
  
    config = mkIf enabled {
  
negative.code:   cfg = config.hardware.nvidia;
    pCfg = cfg.prime;
    syncCfg = pCfg.sync;
    offloadCfg = pCfg.offload;
    primeEnabled = syncCfg.enable || offloadCfg.enable;
  in
  
  {
  