I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
826 B

  1. { config, pkgs, ... }:
  2. let
  3. myIntelBusId = "PCI:0:2:0";
  4. myNvidiaBusId = "PCI:1:0:0";
  5. myNvidiaOffload = pkgs.writeShellScriptBin "nvidia-offload" ''
  6. export __NV_PRIME_RENDER_OFFLOAD=1
  7. export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
  8. export __GLX_VENDOR_LIBRARY_NAME=nvidia
  9. export __VK_LAYER_NV_optimus=NVIDIA_only
  10. exec -a "$0" "$@"
  11. '';
  12. in {
  13. # Add the offload script to the $PATH.
  14. environment.systemPackages = [ myNvidiaOffload ];
  15. # Enable the NVIDIA drivers.
  16. # NOTE: You may need to use either of the commands below:
  17. services.xserver.videoDrivers = [ "nvidia" ];
  18. # services.xserver.videoDrivers = [ "modesetting" "nvidia" ];
  19. # Configure `offload-mode'.
  20. hardware.nvidia.prime = {
  21. offload.enable = true;
  22. intelBusId = myIntelBusId;
  23. nvidiaBusId = myNvidiaBusId;
  24. };
  25. }