fix(nixos:hardware) hardware.opengl -> hardware.graphics
This commit is contained in:
parent
bd899fb160
commit
42570b6d00
5 changed files with 26 additions and 13 deletions
|
|
@ -8,7 +8,7 @@
|
|||
cfg = config.ooknet.gaming.gamescope;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
hardware.opengl.extraPackages = [pkgs.gamescope];
|
||||
hardware.graphics.extraPackages = [pkgs.gamescope];
|
||||
programs.gamescope = {
|
||||
enable = true;
|
||||
capSysNice = true;
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
in {
|
||||
config = mkIf (elem "video" features) {
|
||||
hardware = {
|
||||
opengl = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
driSupport32Bit = isx86Linux pkgs;
|
||||
enable32Bit = isx86Linux pkgs;
|
||||
};
|
||||
};
|
||||
xdg.portal = {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (builtins) elem;
|
||||
in {
|
||||
config = mkIf (elem gpu.type ["amd"]) {
|
||||
hardware.opengl = {
|
||||
hardware.graphics = {
|
||||
extraPackages = with pkgs; [
|
||||
vulkan-tools
|
||||
vulkan-loader
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf (elem gpu.type ["intel"]) {
|
||||
services.xserver.videoDrivers = ["modesetting"];
|
||||
hardware.opengl = {
|
||||
hardware.graphics = {
|
||||
extraPackages = with pkgs; [
|
||||
vaapiIntel
|
||||
vaapiVdpau
|
||||
|
|
@ -29,7 +29,7 @@ in {
|
|||
];
|
||||
};
|
||||
boot.initrd.kernelModules = ["i915"];
|
||||
environment.variables = mkIf config.hardware.opengl.enable {
|
||||
environment.variables = mkIf config.hardware.graphics.enable {
|
||||
VDPAU_DRIVER = "va_gl";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,25 +7,27 @@
|
|||
gpu = config.ooknet.host.hardware.gpu;
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (builtins) elem;
|
||||
production = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
# beta = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
# production = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
beta = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
in {
|
||||
# TODO: make option to choose nvidia package
|
||||
config = mkIf (elem gpu.type ["nvidia"]) {
|
||||
config = mkIf (gpu.type == "nvidia") {
|
||||
# need this for wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
hardware = {
|
||||
nvidia = {
|
||||
open = mkDefault true;
|
||||
package = production;
|
||||
open = false;
|
||||
package = beta;
|
||||
forceFullCompositionPipeline = true;
|
||||
nvidiaSettings = false;
|
||||
nvidiaPersistenced = true;
|
||||
modesetting.enable = true;
|
||||
powerManagement = {
|
||||
enable = mkDefault true;
|
||||
enable = mkDefault false;
|
||||
finegrained = mkDefault false;
|
||||
};
|
||||
};
|
||||
opengl = {
|
||||
graphics = {
|
||||
extraPackages = with pkgs; [nvidia-vaapi-driver];
|
||||
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver];
|
||||
};
|
||||
|
|
@ -47,5 +49,16 @@ in {
|
|||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
NVD_BACKEND = "direct";
|
||||
};
|
||||
# https://github.com/ventureoo/nvidia-tweaks
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="bind", SUBSYSTEM=="pci", DRIVERS=="nvidia", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", TEST=="power/control", ATTR{power/control}="auto"
|
||||
ACTION=="unbind", SUBSYSTEM=="pci", DRIVERS=="nvidia", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", TEST=="power/control", ATTR{power/control}="on"
|
||||
'';
|
||||
boot.kernelParams = [
|
||||
"nvidia.NVreg_UsePageAttributeTable=1"
|
||||
"nvidia.NVreg_InitializeSystemMemoryAllocations=0"
|
||||
"nvidia.NVreg_EnableStreamMemOPs=1"
|
||||
"nvidia.NVreg_RegistryDwords=__REGISTRYDWORDS"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue