install nvidia drivers for sparky

This commit is contained in:
Sam 2024-05-29 20:14:20 +01:00
parent 393c5b6a91
commit eca3a72a8f
1 changed files with 26 additions and 3 deletions

View File

@ -45,20 +45,43 @@ in
enableIPv6 = false;
};
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
# Add additional package names here
"nvidia-x11"
"nvidia-settings"
"nvidia-persistenced"
];
services.displayManager.defaultSession = "cinnamon";
services.libinput.enable = true;
services.xserver = {
enable = true;
videoDrivers = [ "modesetting" ];
videoDrivers = [ "nvidia" ];
displayManager.lightdm.enable = true;
exportConfiguration = true;
deviceSection = ''
Option "DRI" "2"
Option "TearFree" "true"
'';
desktopManager = {
cinnamon.enable = true;
};
};
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver
hardware.nvidia = {
# https://nixos.wiki/wiki/Nvidia
modesetting.enable = true;
powerManagement.enable = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}