Update
This commit is contained in:
parent
aae1271cf0
commit
eb94f6b527
@ -2,9 +2,8 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../shared/fonts.nix
|
../shared/fonts.nix
|
||||||
# ../shared/nvidia.nix
|
../shared/nvidia.nix
|
||||||
# ../shared/prime.nix
|
../shared/prime.nix
|
||||||
../shared/testnvidia.nix
|
|
||||||
../shared/tuigreet.nix
|
../shared/tuigreet.nix
|
||||||
./variables.nix
|
./variables.nix
|
||||||
];
|
];
|
||||||
|
@ -1,21 +1,52 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ lib, pkgs, config, ... }:
|
||||||
hardware.opengl = {
|
let
|
||||||
enable = true;
|
nvidiaDriverChannel =
|
||||||
driSupport = true;
|
config.boot.kernelPackages.nvidiaPackages.beta; # stable, latest, etc.
|
||||||
driSupport32Bit = true;
|
in {
|
||||||
extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ];
|
# Load nvidia driver for Xorg and Wayland
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc.
|
||||||
|
boot.kernelParams =
|
||||||
|
lib.optionals (lib.elem "nvidia" config.services.xserver.videoDrivers) [
|
||||||
|
"nvidia-drm.modeset=1"
|
||||||
|
"nvidia_drm.fbdev=1"
|
||||||
|
];
|
||||||
|
environment.variables = {
|
||||||
|
VK_DRIVER_FILES =
|
||||||
|
/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json;
|
||||||
|
GBM_BACKEND = "nvidia-drm";
|
||||||
|
WLR_NO_HARDWARE_CURSORS = "1";
|
||||||
|
LIBVA_DRIVER_NAME = "nvidia"; # hardware acceleration
|
||||||
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||||
};
|
};
|
||||||
|
nixpkgs.config = {
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
nvidia.acceptLicense = true;
|
||||||
|
allowUnfreePredicate = pkg:
|
||||||
boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
|
builtins.elem (lib.getName pkg) [
|
||||||
|
"cudatoolkit"
|
||||||
hardware.nvidia = {
|
"nvidia-persistenced"
|
||||||
modesetting.enable = true;
|
"nvidia-settings"
|
||||||
powerManagement.enable = true;
|
"nvidia-x11"
|
||||||
powerManagement.finegrained = false;
|
];
|
||||||
open = false;
|
};
|
||||||
nvidiaSettings = true;
|
hardware = {
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
nvidia = {
|
||||||
|
open = false;
|
||||||
|
nvidiaSettings = false;
|
||||||
|
powerManagement.enable =
|
||||||
|
false; # This can cause sleep/suspend to fail and saves entire VRAM to /tmp/
|
||||||
|
modesetting.enable = true;
|
||||||
|
package = nvidiaDriverChannel;
|
||||||
|
};
|
||||||
|
opengl = {
|
||||||
|
enable = true;
|
||||||
|
package = nvidiaDriverChannel;
|
||||||
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
nvidia-vaapi-driver
|
||||||
|
vaapiVdpau
|
||||||
|
libvdpau-va-gl
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
|
||||||
let
|
|
||||||
nvidiaDriverChannel =
|
|
||||||
config.boot.kernelPackages.nvidiaPackages.beta; # stable, latest, etc.
|
|
||||||
in {
|
|
||||||
# Load nvidia driver for Xorg and Wayland
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc.
|
|
||||||
boot.kernelParams =
|
|
||||||
lib.optionals (lib.elem "nvidia" config.services.xserver.videoDrivers) [
|
|
||||||
"nvidia-drm.modeset=1"
|
|
||||||
"nvidia_drm.fbdev=1"
|
|
||||||
];
|
|
||||||
environment.variables = {
|
|
||||||
VK_DRIVER_FILES =
|
|
||||||
/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json;
|
|
||||||
GBM_BACKEND = "nvidia-drm";
|
|
||||||
WLR_NO_HARDWARE_CURSORS = "1";
|
|
||||||
LIBVA_DRIVER_NAME = "nvidia"; # hardware acceleration
|
|
||||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
|
||||||
};
|
|
||||||
nixpkgs.config = {
|
|
||||||
nvidia.acceptLicense = true;
|
|
||||||
allowUnfreePredicate = pkg:
|
|
||||||
builtins.elem (lib.getName pkg) [
|
|
||||||
"cudatoolkit"
|
|
||||||
"nvidia-persistenced"
|
|
||||||
"nvidia-settings"
|
|
||||||
"nvidia-x11"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
hardware = {
|
|
||||||
nvidia = {
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = false;
|
|
||||||
powerManagement.enable =
|
|
||||||
false; # This can cause sleep/suspend to fail and saves entire VRAM to /tmp/
|
|
||||||
modesetting.enable = true;
|
|
||||||
package = nvidiaDriverChannel;
|
|
||||||
};
|
|
||||||
opengl = {
|
|
||||||
enable = true;
|
|
||||||
package = nvidiaDriverChannel;
|
|
||||||
driSupport = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
nvidia-vaapi-driver
|
|
||||||
vaapiVdpau
|
|
||||||
libvdpau-va-gl
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user