Skip to content

Commit

Permalink
nvidia-x11.vulkan_beta: init at 450.56.11 (#97882)
Browse files Browse the repository at this point in the history
- This is fetched from a different URL, so allow passing that explicitly.

- There also isn't an nvidia-persistenced or nvidia-settings release for
  this version, so use 450.57 instead. Also implement passing
  persistenced and settings version explicitly.

Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
  • Loading branch information
expipiplus1 and veprbl committed Sep 24, 2020
1 parent f506111 commit 99d2db8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
2 changes: 2 additions & 0 deletions nixos/modules/hardware/video/nvidia.nix
Expand Up @@ -16,6 +16,8 @@ let
kernelPackages.nvidia_x11
else if elem "nvidiaBeta" drivers then
kernelPackages.nvidia_x11_beta
else if elem "nvidiaVulkanBeta" drivers then
kernelPackages.nvidia_x11_vulkan_beta
else if elem "nvidiaLegacy304" drivers then
kernelPackages.nvidia_x11_legacy304
else if elem "nvidiaLegacy340" drivers then
Expand Down
11 changes: 11 additions & 0 deletions pkgs/os-specific/linux/nvidia-x11/default.nix
Expand Up @@ -32,6 +32,17 @@ rec {
# No active beta right now
beta = stable;

# Vulkan developer beta driver
vulkan_beta = generic {
version = "450.56.11";
persistencedVersion = "450.57";
settingsVersion = "450.57";
sha256_64bit = "1k64h8sp4rf6kc7liypznjgkmxi67njy1s8xy2r341fhl62pl010";
settingsSha256 = "1clbj9a3kv3j8jg35c197gd7b3f9f9f4h9ll5hlax95hdg12lgan";
persistencedSha256 = "17747z1fsbiznfsmahxmz8kmhwwcjanpfih60v5mwzk63gy4i3d5";
url = "https://developer.nvidia.com/vulkan-beta-4505611-linux";
};

# Last one supporting x86
legacy_390 = generic {
version = "390.138";
Expand Down
10 changes: 7 additions & 3 deletions pkgs/os-specific/linux/nvidia-x11/generic.nix
@@ -1,8 +1,11 @@
{ version
, url ? null
, sha256_32bit ? null
, sha256_64bit
, settingsSha256
, settingsVersion ? version
, persistencedSha256
, persistencedVersion ? version
, useGLVND ? true
, useProfiles ? true
, preferGtk2 ? false
Expand All @@ -11,7 +14,7 @@
, prePatch ? ""
, patches ? []
, broken ? false
}:
}@args:

{ stdenv, callPackage, pkgs, pkgsi686Linux, fetchurl
, kernel ? null, perl, nukeReferences
Expand Down Expand Up @@ -46,12 +49,12 @@ let
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run";
url = args.url or "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run";
sha256 = sha256_64bit;
}
else if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run";
url = args.url or "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run";
sha256 = sha256_32bit;
}
else throw "nvidia-x11 does not support platform ${stdenv.hostPlatform.system}";
Expand Down Expand Up @@ -89,6 +92,7 @@ let
withGtk3 = !preferGtk2;
};
persistenced = mapNullable (hash: callPackage (import ./persistenced.nix self hash) { }) persistencedSha256;
inherit persistencedVersion settingsVersion;
};

meta = with stdenv.lib; {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/nvidia-x11/persistenced.nix
Expand Up @@ -2,14 +2,14 @@ nvidia_x11: sha256:

{ stdenv, fetchFromGitHub, m4 }:

stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "nvidia-persistenced";
inherit (nvidia_x11) version;
version = nvidia_x11.persistencedVersion;

src = fetchFromGitHub {
owner = "NVIDIA";
repo = "nvidia-persistenced";
rev = nvidia_x11.version;
rev = nvidia_x11.persistencedVersion;
inherit sha256;
};

Expand Down
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/nvidia-x11/settings.nix
Expand Up @@ -9,13 +9,13 @@ let
src = fetchFromGitHub {
owner = "NVIDIA";
repo = "nvidia-settings";
rev = nvidia_x11.version;
rev = nvidia_x11.settingsVersion;
inherit sha256;
};

libXNVCtrl = stdenv.mkDerivation {
pname = "libXNVCtrl";
inherit (nvidia_x11) version;
version = nvidia_x11.settingsVersion;
inherit src;

buildInputs = [ libXrandr libXext ];
Expand All @@ -42,7 +42,7 @@ in

stdenv.mkDerivation {
pname = "nvidia-settings";
inherit (nvidia_x11) version;
version = nvidia_x11.settingsVersion;
inherit src;

nativeBuildInputs = [ pkgconfig m4 ];
Expand Down
11 changes: 6 additions & 5 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -17919,11 +17919,12 @@ in

nvidiaPackages = dontRecurseIntoAttrs (callPackage ../os-specific/linux/nvidia-x11 { });

nvidia_x11_legacy304 = nvidiaPackages.legacy_304;
nvidia_x11_legacy340 = nvidiaPackages.legacy_340;
nvidia_x11_legacy390 = nvidiaPackages.legacy_390;
nvidia_x11_beta = nvidiaPackages.beta;
nvidia_x11 = nvidiaPackages.stable;
nvidia_x11_legacy304 = nvidiaPackages.legacy_304;
nvidia_x11_legacy340 = nvidiaPackages.legacy_340;
nvidia_x11_legacy390 = nvidiaPackages.legacy_390;
nvidia_x11_beta = nvidiaPackages.beta;
nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta;
nvidia_x11 = nvidiaPackages.stable;

openrazer = callPackage ../os-specific/linux/openrazer/driver.nix { };

Expand Down

0 comments on commit 99d2db8

Please sign in to comment.