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;
|
cfg = config.ooknet.gaming.gamescope;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
hardware.opengl.extraPackages = [pkgs.gamescope];
|
hardware.graphics.extraPackages = [pkgs.gamescope];
|
||||||
programs.gamescope = {
|
programs.gamescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
capSysNice = true;
|
capSysNice = true;
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf (elem "video" features) {
|
config = mkIf (elem "video" features) {
|
||||||
hardware = {
|
hardware = {
|
||||||
opengl = {
|
graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport32Bit = isx86Linux pkgs;
|
enable32Bit = isx86Linux pkgs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
inherit (builtins) elem;
|
inherit (builtins) elem;
|
||||||
in {
|
in {
|
||||||
config = mkIf (elem gpu.type ["amd"]) {
|
config = mkIf (elem gpu.type ["amd"]) {
|
||||||
hardware.opengl = {
|
hardware.graphics = {
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
vulkan-tools
|
vulkan-tools
|
||||||
vulkan-loader
|
vulkan-loader
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf (elem gpu.type ["intel"]) {
|
config = mkIf (elem gpu.type ["intel"]) {
|
||||||
services.xserver.videoDrivers = ["modesetting"];
|
services.xserver.videoDrivers = ["modesetting"];
|
||||||
hardware.opengl = {
|
hardware.graphics = {
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
vaapiIntel
|
vaapiIntel
|
||||||
vaapiVdpau
|
vaapiVdpau
|
||||||
|
|
@ -29,7 +29,7 @@ in {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
boot.initrd.kernelModules = ["i915"];
|
boot.initrd.kernelModules = ["i915"];
|
||||||
environment.variables = mkIf config.hardware.opengl.enable {
|
environment.variables = mkIf config.hardware.graphics.enable {
|
||||||
VDPAU_DRIVER = "va_gl";
|
VDPAU_DRIVER = "va_gl";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,27 @@
|
||||||
gpu = config.ooknet.host.hardware.gpu;
|
gpu = config.ooknet.host.hardware.gpu;
|
||||||
inherit (lib) mkIf mkDefault;
|
inherit (lib) mkIf mkDefault;
|
||||||
inherit (builtins) elem;
|
inherit (builtins) elem;
|
||||||
production = config.boot.kernelPackages.nvidiaPackages.production;
|
# production = config.boot.kernelPackages.nvidiaPackages.production;
|
||||||
# beta = config.boot.kernelPackages.nvidiaPackages.beta;
|
beta = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
in {
|
in {
|
||||||
# TODO: make option to choose nvidia package
|
# 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 = {
|
hardware = {
|
||||||
nvidia = {
|
nvidia = {
|
||||||
open = mkDefault true;
|
open = false;
|
||||||
package = production;
|
package = beta;
|
||||||
forceFullCompositionPipeline = true;
|
forceFullCompositionPipeline = true;
|
||||||
nvidiaSettings = false;
|
nvidiaSettings = false;
|
||||||
nvidiaPersistenced = true;
|
nvidiaPersistenced = true;
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
powerManagement = {
|
powerManagement = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault false;
|
||||||
finegrained = mkDefault false;
|
finegrained = mkDefault false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
opengl = {
|
graphics = {
|
||||||
extraPackages = with pkgs; [nvidia-vaapi-driver];
|
extraPackages = with pkgs; [nvidia-vaapi-driver];
|
||||||
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver];
|
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver];
|
||||||
};
|
};
|
||||||
|
|
@ -47,5 +49,16 @@ in {
|
||||||
LIBVA_DRIVER_NAME = "nvidia";
|
LIBVA_DRIVER_NAME = "nvidia";
|
||||||
NVD_BACKEND = "direct";
|
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