From 19e9c2fb7a9877f2864922276cd6ca62b07fa37a Mon Sep 17 00:00:00 2001 From: liamwb Date: Tue, 9 Jul 2024 14:02:17 +1000 Subject: [PATCH] naively pasted code from our forum discussion --- dell/xps/15-9560/default.nix | 42 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/dell/xps/15-9560/default.nix b/dell/xps/15-9560/default.nix index aee5665..18be8fd 100644 --- a/dell/xps/15-9560/default.nix +++ b/dell/xps/15-9560/default.nix @@ -4,36 +4,30 @@ ../../../common/gpu/intel/kaby-lake ../../../common/pc/laptop ./xps-common.nix - - # FIXME: remove this when bumblebee works again - ../../../common/gpu/nvidia/disable.nix ]; +# enable opengpl and gpu drivers + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; - /* Bumblebee seems to fail to evaluate: - (stack trace truncated; use '--show-trace' to show the full trace) + services.xserver.videoDrivers = ["nvidia"]; - error: assertion '(useSettings -> (! libsOnly))' failed + hardware.nvidia.modesetting.enable = true; - at /home/joerg/git/nixpkgs/pkgs/os-specific/linux/nvidia-x11/generic.nix:61:1: + hardware.nvidia.prime = { + offload = { + enable = true; + enableOffloadCmd = true; # provides the nvidia-offload command + }; - 60| - 61| assert useSettings -> !libsOnly; - | ^ - 62| assert !libsOnly -> kernel != null; +# integrated + intelBusId = "PCI:0:2:0"; - # This configuration makes intel default and optionaly applications could run nvidia with optirun. - # To Optimize for your use case import intel or nvidia only configuration instead - # xps-9560/intel - # or - # xps-9560/nvidia +# dedicated + nvidiaBusId = "PCI:1:0:0"; + }; - - ##### bumblebee working, needs reboot to take affect and to use it run: optirun "" - services.xserver.videoDrivers = [ "intel" "nvidia" ]; - boot.blacklistedKernelModules = [ "nouveau" "bbswitch" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ]; - hardware.bumblebee.enable = lib.mkDefault true; - hardware.bumblebee.pmMethod = lib.mkDefault "none"; - */ }