From 859e3d1771641e59d440f0fac36b1855fec25b98 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 10 Jun 2024 11:11:29 +0200 Subject: [PATCH] feat: enable nvidia on laptop --- hosts/nom/default.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/hosts/nom/default.nix b/hosts/nom/default.nix index dc5a22b..2968051 100644 --- a/hosts/nom/default.nix +++ b/hosts/nom/default.nix @@ -1,5 +1,6 @@ { inputs, + lib, pkgs, ... }: { @@ -12,6 +13,7 @@ ../../config/hardware/intel.nix ../../config/hardware/physical.nix + ../../config/hardware/bluetooth.nix ../../config/dev ../../config/graphical @@ -35,5 +37,35 @@ packages = [pkgs.terminus_font]; }; + # FIXME: fuck optional modules and make this more adjustable via settings + graphical.gaming.enable = true; + boot.blacklistedKernelModules = ["nouveau"]; + services.xserver.videoDrivers = lib.mkForce ["nvidia"]; + + hardware = { + nvidia = { + prime = { + offload.enable = true; + offload.enableOffloadCmd = true; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + modesetting.enable = true; + nvidiaPersistenced = true; + nvidiaSettings = true; + open = false; + powerManagement.enable = false; + }; + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ + vaapiVdpau + nvidia-vaapi-driver + ]; + }; + }; + topology.self.icon = "devices.laptop"; }