From 8f6fa5939becdf3b95f7dc49afcf3745edb27a06 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sat, 17 Aug 2024 19:01:35 +0200 Subject: [PATCH] fix opengl --- .../cherry/hardware-configuration/default.nix | 3 +++ .../hardware-configuration/graphics.nix | 19 +++++++++++++++++++ machines/chungus/configuration.nix | 9 --------- .../hardware-configuration/default.nix | 1 + .../hardware-configuration/graphics.nix | 19 +++++++++++++++++++ 5 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 machines/cherry/hardware-configuration/graphics.nix create mode 100644 machines/chungus/hardware-configuration/graphics.nix diff --git a/machines/cherry/hardware-configuration/default.nix b/machines/cherry/hardware-configuration/default.nix index 141fce2..cdf3b7c 100644 --- a/machines/cherry/hardware-configuration/default.nix +++ b/machines/cherry/hardware-configuration/default.nix @@ -3,6 +3,7 @@ imports = [ ./disko-config.nix ./hardware-configuration.nix + ./graphics.nix ]; boot.loader.efi.canTouchEfiVariables = true; @@ -23,4 +24,6 @@ ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="zfs_member", ATTR{../queue/scheduler}="none" ''; + + } diff --git a/machines/cherry/hardware-configuration/graphics.nix b/machines/cherry/hardware-configuration/graphics.nix new file mode 100644 index 0000000..d1edcd0 --- /dev/null +++ b/machines/cherry/hardware-configuration/graphics.nix @@ -0,0 +1,19 @@ +# https://wiki.nixos.org/wiki/Accelerated_Video_Playback +{ pkgs, ... }: +{ + + hardware.graphics.enable = true; + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + #vaapi-intel-hybrid + intel-vaapi-driver # For older processors. LIBVA_DRIVER_NAME=i965 + #vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + #vaapiVdpau + #libvdpau-va-gl + ]; + hardware.graphics.enable32Bit = true; + hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ intel-vaapi-driver ]; + + environment.sessionVariables = { LIBVA_DRIVER_NAME = "i965"; }; # Optionally, set the environment variable + +} diff --git a/machines/chungus/configuration.nix b/machines/chungus/configuration.nix index b43318f..21d9927 100644 --- a/machines/chungus/configuration.nix +++ b/machines/chungus/configuration.nix @@ -69,15 +69,6 @@ networking.hostName = "chungus"; - hardware.graphics.enable = true; - hardware.graphics.enable32Bit = true; - hardware.graphics.extraPackages = with pkgs; [ - intel-media-driver # LIBVA_DRIVER_NAME=iHD - vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) - vaapiVdpau - libvdpau-va-gl - ]; - # nix-shell -p speedtest_cli --run speedtest #configuration.fireqos = { # enable = false; diff --git a/machines/chungus/hardware-configuration/default.nix b/machines/chungus/hardware-configuration/default.nix index 3e2c559..336a0ba 100644 --- a/machines/chungus/hardware-configuration/default.nix +++ b/machines/chungus/hardware-configuration/default.nix @@ -3,6 +3,7 @@ imports = [ ./disko-config.nix ./hardware-configuration.nix + ./graphics.nix ]; boot.loader.efi.canTouchEfiVariables = true; diff --git a/machines/chungus/hardware-configuration/graphics.nix b/machines/chungus/hardware-configuration/graphics.nix new file mode 100644 index 0000000..d1edcd0 --- /dev/null +++ b/machines/chungus/hardware-configuration/graphics.nix @@ -0,0 +1,19 @@ +# https://wiki.nixos.org/wiki/Accelerated_Video_Playback +{ pkgs, ... }: +{ + + hardware.graphics.enable = true; + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + #vaapi-intel-hybrid + intel-vaapi-driver # For older processors. LIBVA_DRIVER_NAME=i965 + #vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + #vaapiVdpau + #libvdpau-va-gl + ]; + hardware.graphics.enable32Bit = true; + hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ intel-vaapi-driver ]; + + environment.sessionVariables = { LIBVA_DRIVER_NAME = "i965"; }; # Optionally, set the environment variable + +}