From cc19379f93a1ec1f23836d8bade06fe7c182ffbe Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Tue, 11 Feb 2025 11:42:02 -0800 Subject: Selectively enable fbc and nvenc nvidia-patch based on availability --- hosts/arrakis/hardware-configuration.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hosts/arrakis/hardware-configuration.nix') diff --git a/hosts/arrakis/hardware-configuration.nix b/hosts/arrakis/hardware-configuration.nix index 7e1af4f..c709789 100644 --- a/hosts/arrakis/hardware-configuration.nix +++ b/hosts/arrakis/hardware-configuration.nix @@ -58,11 +58,13 @@ }; nvidia = let - video = config.boot.kernelPackages.nvidiaPackages.beta; + betaPkg = config.boot.kernelPackages.nvidiaPackages.beta; + pkgAfterFbc = if builtins.hasAttr betaPkg.version pkgs.nvidia-patch-list.fbc then pkgs.nvidia-patch.patch-fbc betaPkg else betaPkg; + finalPkg = if builtins.hasAttr betaPkg.version pkgs.nvidia-patch-list.nvenc then pkgs.nvidia-patch.patch-nvenc pkgAfterFbc else pkgAfterFbc; in { modesetting.enable = true; open = true; - package = if builtins.hasAttr video.version pkgs.nvidia-patch-list.fbc then pkgs.nvidia-patch.patch-nvenc (pkgs.nvidia-patch.patch-fbc video) else video; + package = if finalPkg == betaPkg then betaPkg else finalPkg; }; printers = let -- cgit v1.2.3