Added nvidia drivers and gaming profile

This commit is contained in:
marc
2022-11-04 19:32:53 +01:00
parent f4d6589bd1
commit 0f4b895d38
9 changed files with 89 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
{
imports = [
./hardware.nix
./nvidia.nix
];
# - Basic --------------------------------------
@@ -19,9 +20,12 @@
# - Services -----------------------------------
samfelag.profiles.desktop = {
enable = true;
laptop = true;
samfelag.profiles = {
desktop = {
enable = true;
laptop = true;
};
gaming.enable = true;
};
system.stateVersion = "22.05";

View File

@@ -0,0 +1,29 @@
{ config, pkgs, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'';
in
{
environment.systemPackages = [ nvidia-offload ];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
hardware.nvidia.prime = {
offload.enable = true;
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
};
}