Skip to content

Instantly share code, notes, and snippets.

@unode
Created February 3, 2019 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unode/a86ad712fbc698d71c847b89d8733c89 to your computer and use it in GitHub Desktop.
Save unode/a86ad712fbc698d71c847b89d8733c89 to your computer and use it in GitHub Desktop.
nvidia_only.nix
{ config, pkgs, lib, ... }:
## This configuration forces exclusive use of NVIDIA in a laptop with NVIDIA+Intel GPUs
{
imports = [
# Include the base configuration which setups Intel as primary and NVIDIA through PRIME (primerun)
./configuration.nix
];
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
nvidia.optimus_prime = {
enable = true;
# Bus ID of the NVIDIA GPU. You can find it using lspci
nvidiaBusId = "PCI:1:0:0";
# Bus ID of the Intel GPU. You can find it using lspci
intelBusId = "PCI:0:2:0";
};
# Also override the settings from configuration.nix
nvidiaOptimus.disable = false;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment