(re)switch to Nvidia drivers

This commit is contained in:
Victor Mignot 2024-11-28 18:30:52 +01:00
parent c38acd0f0f
commit 783475e2f0
No known key found for this signature in database
GPG key ID: 5E7F2CE1BEAFED3D
2 changed files with 10 additions and 9 deletions

View file

@ -35,6 +35,7 @@ with lib;
config = {
boot.kernelParams = mkIf (gpu == "intel") [ "i915.enable_guc=2" ];
services.xserver.videoDrivers = mkIf (gpu == "nvidia") [ "nvidia" ];
# Small hack as this option path changes between 24.05 and unstable
hardware.${hwAccelerationOptionPath} = {
@ -48,5 +49,12 @@ with lib;
];
};
hardware.nvidia = mkIf (gpu == "nvidia") {
enable = true;
open = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
};
}

View file

@ -9,14 +9,6 @@
with lib;
let
isQwerty = keymap == "us";
wlrRendererLine =
if isNvidiaGpu then
''
export MESA_LOADER_DRIVER_OVERRIDE=zink
export NOUVEAU_USE_ZINK=1
''
else
"";
monitorModule = types.submodule {
options = {
name = mkOption { type = types.str; };
@ -104,6 +96,8 @@ in
package = null;
checkConfig = false;
extraOptions = if isNvidiaGpu then [ "--unsupported-gpu" ] else [ ];
config = rec {
modifier = "Mod4";
@ -305,7 +299,6 @@ in
xwayland = true;
extraSessionCommands = ''
${wlrRendererLine}
export WLR_NO_HARDWARE_CURSORS=1
export XDG_CURRENT_DESKTOP=sway
export _JAVA_AWT_WM_NONREPARENTING=1