From 27d72f5abb99ef06a309d8e36ac042f8686ae5b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?PedroHLC=20=E2=98=AD?= Date: Wed, 24 Aug 2022 16:21:07 -0300 Subject: [PATCH] nvidia_x11: mark broken --- pkgs/os-specific/linux/nvidia-x11/default.nix | 8 +++++++- pkgs/os-specific/linux/nvidia-x11/generic.nix | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 3aa0ecaa6cd4..598ac6a4c451 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -13,6 +13,8 @@ let kernel = callPackage # a hacky way of extracting parameters from callPackage ({ kernel, libsOnly ? false }: if libsOnly then { } else kernel) { }; + kernelModVersion = lib.versions.majorMinor kernel.modDirVersion; + selectHighestVersion = a: b: if lib.versionOlder a.version b.version then b else a; @@ -30,6 +32,8 @@ rec { openSha256 = "sha256-GCCDnaDsbXTmbCYZBCM3fpHmOSWti/DkBJwYrRGAMPI="; settingsSha256 = "sha256-kBELMJCIWD9peZba14wfCoxsi3UXO3ehFYcVh4nvzVg="; persistencedSha256 = "sha256-P8oT7g944HvNk2Ot/0T0sJM7dZs+e0d+KwbwRrmsuDY="; + + brokenOpen = kernelModVersion == "5.4" && kernel.isHardened; }; latest = selectHighestVersion production (generic { @@ -58,6 +62,8 @@ rec { settingsSha256 = "sha256-XwdMsAAu5132x2ZHqjtFvcBJk6Dao7I86UksxrOkknU="; persistencedSha256 = "sha256-BTfYNDJKe4tOvV71/1JJSPltJua0Mx/RvDcWT5ccRRY="; url = "https://developer.nvidia.com/vulkan-beta-${lib.concatStrings (lib.splitString "." version)}-linux"; + + broken = kernelModVersion == "5.4" && kernel.isHardened; }; # Update note: @@ -84,7 +90,7 @@ rec { patches = let patch390 = o: - (lib.optional ((lib.versions.majorMinor kernel.modDirVersion) == o.version) (fetchpatch { + (lib.optional (kernelModVersion == o.version) (fetchpatch { inherit (o) sha256; url = "https://gitlab.com/herecura/packages/nvidia-390xx-dkms/-/raw/herecura/kernel-${o.version}.patch"; })); diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index d6dcc7ad6cd0..b694dc1fd0ca 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -15,6 +15,7 @@ , prePatch ? "" , patches ? [] , broken ? false +, brokenOpen ? broken }@args: { lib, stdenv, callPackage, pkgs, pkgsi686Linux, fetchurl @@ -104,8 +105,9 @@ let passthru = { open = mapNullable (hash: callPackage ./open.nix { - inherit hash broken; + inherit hash; nvidia_x11 = self; + broken = brokenOpen; }) openSha256; settings = (if settings32Bit then pkgsi686Linux.callPackage else callPackage) (import ./settings.nix self settingsSha256) { withGtk2 = preferGtk2;