From 36094450fdff0a87fbe704cc456b849701972dae Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sun, 28 Feb 2021 13:31:28 -0300 Subject: [PATCH] Add nvidia-disable profile This is already used in XPS 15-9560, but instead of defining it in XPS 15-9560 let's create a separate profile and expose it for those who want to disable their NVIDIA GPU. --- common/gpu/nvidia-disable.nix | 10 ++++++++++ dell/xps/15-9550/default.nix | 5 ++--- dell/xps/15-9560/intel/default.nix | 10 +--------- flake.nix | 1 + 4 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 common/gpu/nvidia-disable.nix diff --git a/common/gpu/nvidia-disable.nix b/common/gpu/nvidia-disable.nix new file mode 100644 index 0000000..53c53d9 --- /dev/null +++ b/common/gpu/nvidia-disable.nix @@ -0,0 +1,10 @@ +{ lib, pkgs, ... }: + +{ + # This runs only Intel and nvidia does not drain power. + + ##### disable nvidia, very nice battery life. + hardware.nvidiaOptimus.disable = lib.mkDefault true; + boot.blacklistedKernelModules = lib.mkDefault [ "nouveau" "nvidia" ]; + services.xserver.videoDrivers = lib.mkDefault [ "intel" ]; +} diff --git a/dell/xps/15-9550/default.nix b/dell/xps/15-9550/default.nix index 9677972..0fdfeee 100644 --- a/dell/xps/15-9550/default.nix +++ b/dell/xps/15-9550/default.nix @@ -4,6 +4,8 @@ imports = [ ../../../common/cpu/intel ../../../common/pc/laptop + # To just use Intel integrated graphics with Intel's open source driver + # ../../../common/gpu/nvidia-disable ]; # TODO: boot loader @@ -12,7 +14,4 @@ # This will save you money and possibly your life! services.thermald.enable = true; - - # To just use Intel integrated graphics with Intel's open source driver - # hardware.nvidiaOptimus.disable = true; } diff --git a/dell/xps/15-9560/intel/default.nix b/dell/xps/15-9560/intel/default.nix index f203797..7c8eadd 100644 --- a/dell/xps/15-9560/intel/default.nix +++ b/dell/xps/15-9560/intel/default.nix @@ -4,15 +4,7 @@ imports = [ ../../../../common/cpu/intel ../../../../common/pc/laptop + ../../../../common/gpu/nvidia-disable.nix ../xps-common.nix ]; - - - # This runs only Intel and nvidia does not drain power. - - ##### disable nvidia, very nice battery life. - hardware.nvidiaOptimus.disable = lib.mkDefault true; - boot.blacklistedKernelModules = lib.mkDefault [ "nouveau" "nvidia" ]; - services.xserver.videoDrivers = lib.mkDefault [ "intel" ]; - } diff --git a/flake.nix b/flake.nix index 64aa17a..c5d6c2e 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,7 @@ common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake; common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge; common-gpu-nvidia = import ./common/gpu/nvidia.nix; + common-gpu-nvidia-disable = import ./common/gpu/nvidia-disable.nix; common-pc-hdd = import ./common/pc/hdd; common-pc-laptop-hdd = import ./common/pc/laptop/hdd; common-pc-laptop-ssd = import ./common/pc/ssd;